dev
This commit is contained in:
parent
63f1e1f64e
commit
05a38825f9
|
|
@ -131,7 +131,7 @@ body {
|
|||
border-radius: 8px 8px 0 0;
|
||||
}
|
||||
$btn-color: #4D6DE4;
|
||||
$lighter-color: #7c91e3;
|
||||
$lighter-color: rgba(#4D6DE4, 0.5);
|
||||
.default-btn{
|
||||
cursor: pointer;
|
||||
width: 120px;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,96 @@
|
|||
<template>
|
||||
<Mask :width="400" :height="240" :is-show="isShow" @close="isShow=false" :show-footer="true" title="选择模板范围">
|
||||
<template #default>
|
||||
<div class="select">
|
||||
<el-form style="height: 100%">
|
||||
<el-form-item label="药品物资选择范围">
|
||||
<el-cascader :collapse-tags="true" :props="props" :options="allCateList"
|
||||
:show-all-levels="false"
|
||||
v-model="cateIds" clearable @change="change"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
<template #footer>
|
||||
<div class="bottom">
|
||||
<div class="default-btn" @click="isShow=false">上传数据</div>
|
||||
<div class="default-btn" @click="uploadCateIds" style="margin-left: 24px">下载模板</div>
|
||||
<div class="default-btn" @click="isShow=false" style="margin-left: 24px">取消</div>
|
||||
</div>
|
||||
</template>
|
||||
</Mask>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Mask from "@/components/common/Mask.vue";
|
||||
import {defineModel, onMounted, ref} from "vue";
|
||||
import {post} from "@/utils/request.ts";
|
||||
|
||||
const isShow = defineModel()
|
||||
const props = {multiple: true}
|
||||
|
||||
interface CateOption {
|
||||
value: string;
|
||||
label: string;
|
||||
children: { value: number; label: string }[];
|
||||
}
|
||||
|
||||
const typeList = {
|
||||
"1301": "中西成药",
|
||||
"1302": "中药饮片",
|
||||
"1306": "医疗器材",
|
||||
"0": "其他商品",
|
||||
}
|
||||
const cateIds = ref<number[]>([]);
|
||||
const allCateList = ref<CateOption[]>([]);
|
||||
const getAllCate = () => {
|
||||
post("goods/cate/getAllList", null).then((res: any) => {
|
||||
const options = [];
|
||||
for (const key in res) {
|
||||
if (typeList.hasOwnProperty(key)) { // 检查键是否存在
|
||||
options.push({
|
||||
value: key,
|
||||
label: typeList[key as keyof typeof typeList], // 类型断言
|
||||
children: res[key].map((item: { id: number; name: string }) => ({
|
||||
value: item.id,
|
||||
label: item.name
|
||||
})),
|
||||
});
|
||||
}
|
||||
}
|
||||
allCateList.value = options;
|
||||
})
|
||||
}
|
||||
const ids = ref<any>([])
|
||||
const change = (value: any) => {
|
||||
cateIds.value = value
|
||||
ids.value = []
|
||||
}
|
||||
const uploadCateIds = () => {
|
||||
cateIds.value.map((item: any) => {
|
||||
if (item[item.length - 1] === 0) return
|
||||
ids.value.push(item[item.length - 1])
|
||||
})
|
||||
console.log(ids)
|
||||
}
|
||||
onMounted(() => {
|
||||
getAllCate()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.select {
|
||||
height: 100%;
|
||||
padding: 24px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 24px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<Mask :width="400" :height="600" :is-show="isShow" @close="isShow=false" :show-fotter="true" title="药品列表">
|
||||
<Mask :width="400" :height="600" :is-show="isShow" @close="isShow=false" :show-footer="true" title="药品列表">
|
||||
<el-table
|
||||
:data="cateList"
|
||||
style="width: 100%"
|
||||
|
|
|
|||
|
|
@ -54,7 +54,8 @@
|
|||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item prop="supplierId" label="供应商" :rules="formRules.supplierId">
|
||||
<el-select style="width: 130px;margin-right: 10px" v-model="inventory_order_data.supplierId" placeholder="请选择供应商">
|
||||
<el-select style="width: 196px;margin-right: 10px" v-model="inventory_order_data.supplierId"
|
||||
placeholder="请选择供应商">
|
||||
<el-option
|
||||
v-for="item in supplier_list"
|
||||
:key="item.id"
|
||||
|
|
@ -62,8 +63,15 @@
|
|||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
<div class="default-btn" style="height: 100%" @click="addSupplier">
|
||||
<el-icon><Plus /></el-icon>
|
||||
<div class="default-btn"
|
||||
style="
|
||||
height: 32px;
|
||||
width: 32px;
|
||||
line-height: 32px;"
|
||||
@click="addSupplier">
|
||||
<el-icon style="color: #fff">
|
||||
<Plus/>
|
||||
</el-icon>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
|
@ -148,11 +156,11 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="商品追溯码" width="150">
|
||||
<template #default="scope">
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="scope.row.traceabilityCode"-->
|
||||
<!-- placeholder="商品追溯码"-->
|
||||
<!-- style="width: 100px"-->
|
||||
<!-- size="small"/>-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="scope.row.traceabilityCode"-->
|
||||
<!-- placeholder="商品追溯码"-->
|
||||
<!-- style="width: 100px"-->
|
||||
<!-- size="small"/>-->
|
||||
<TraceabilityCodeInput v-model="scope.row.traceabilityCodeList"></TraceabilityCodeInput>
|
||||
</template>
|
||||
|
||||
|
|
@ -173,8 +181,8 @@
|
|||
style="color: #FF282E">{{ inventory_order_data.totalPrice.toFixed(2) }}</span>
|
||||
</div>
|
||||
<div class="btn">
|
||||
<el-button type="primary" @click="confirm">确认</el-button>
|
||||
<el-button type="primary" @click="exit">关闭</el-button>
|
||||
<div class="default-btn" @click="exit">关闭</div>
|
||||
<div class="default-btn" @click="confirm" style="margin-left: 24px">确认</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -296,7 +304,7 @@ function getFormattedDate() {
|
|||
}
|
||||
|
||||
let confirm = async () => {
|
||||
console.log('table_list.value++++++++++++++',table_list.value)
|
||||
console.log('table_list.value++++++++++++++', table_list.value)
|
||||
// 进行表单验证
|
||||
try {
|
||||
await orderForm.value.validate()
|
||||
|
|
@ -327,7 +335,7 @@ let confirm = async () => {
|
|||
}
|
||||
table_list.value.forEach((item: any) => {
|
||||
console.log(item.traceabilityCodeList)
|
||||
item.traceabilityCode= JSON.stringify(item.traceabilityCodeList)
|
||||
item.traceabilityCode = JSON.stringify(item.traceabilityCodeList)
|
||||
})
|
||||
let data = {
|
||||
inventoryOrder: JSON.parse(JSON.stringify(inventory_order_data.value)),
|
||||
|
|
@ -400,8 +408,7 @@ const init = () => {
|
|||
}
|
||||
const managerUserList: any = ref([])
|
||||
const getManagerUserList = () => {
|
||||
post("manager/user/list", {
|
||||
}).then((res: any) => {
|
||||
post("manager/user/list", {}).then((res: any) => {
|
||||
managerUserList.value = res
|
||||
})
|
||||
}
|
||||
|
|
@ -516,6 +523,9 @@ defineExpose({init})
|
|||
font-size: 22px;
|
||||
color: #333333;
|
||||
font-style: normal;
|
||||
.btn{
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
.error {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-cascader style="width: 180px;height: 42px" :options="allCateList" :show-all-levels="false"
|
||||
<el-cascader :collapse-tags="true" :props="props" style="width: 180px;height: 42px" :options="allCateList" :show-all-levels="false"
|
||||
v-model="searchModel.cateId" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
|
|
@ -426,6 +426,7 @@ const getStatisticsData = () => {
|
|||
statisticsData.value = res
|
||||
})
|
||||
}
|
||||
const props = { multiple: true }
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.v-enter-active,
|
||||
|
|
|
|||
|
|
@ -77,7 +77,8 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="addBtn">
|
||||
<span @click="openAdd">新增采购</span>
|
||||
<span class="default-btn" @click="openAdd">新增采购</span>
|
||||
<span class="default-btn" @click="openUpload">一键导入</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content_list">
|
||||
|
|
@ -129,6 +130,7 @@
|
|||
</div>
|
||||
<AddOrder ref="addOrderRef" @close="closeAddOrder"/>
|
||||
<EditOrder ref="editOrderRef" @close="closeEditOrder" @updateOrderDetail="init"/>
|
||||
<UpLoad v-model="show"></UpLoad>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -141,6 +143,7 @@ import Mask from "@/components/common/Mask.vue";
|
|||
import EditOrder from "@/components/inventory/purchase/EditOrder.vue";
|
||||
import {Plus, Refresh, Search, SemiSelect} from "@element-plus/icons-vue";
|
||||
import {formatDateArray, getEndOfDay} from "@/utils/dateUtils.ts";
|
||||
import UpLoad from "@/components/inventory/Upload.vue";
|
||||
|
||||
let tableData = ref([])
|
||||
let is_edit = ref(false)
|
||||
|
|
@ -242,6 +245,10 @@ const resetSearch = () => {
|
|||
}
|
||||
init()
|
||||
}
|
||||
const show = ref(false)
|
||||
const openUpload= ()=>{
|
||||
show.value=true
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
@use "@/assets/scss/base.scss";
|
||||
|
|
@ -377,26 +384,9 @@ const resetSearch = () => {
|
|||
}
|
||||
|
||||
.addBtn {
|
||||
span {
|
||||
span{
|
||||
display: inline-block;
|
||||
width: 120px;
|
||||
height: 42px;
|
||||
background: #FFFFFF;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #4D6DE4;
|
||||
margin-right: 24px;
|
||||
font-weight: 500;
|
||||
font-size: 16px;
|
||||
color: #4D6DE4;
|
||||
text-align: center;
|
||||
line-height: 42px;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background: #4D6DE4;
|
||||
color: #fff;
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue