|
@@ -1,95 +1,126 @@
|
|
|
<!-- -->
|
|
|
<template>
|
|
|
<div class="sellManage">
|
|
|
- <searchAdd isButtom="添加" :inline="false">
|
|
|
+ <searchAdd isButtom="添加" :inline="true" @event="eventFun">
|
|
|
<template #searchConter>
|
|
|
- <el-form-item label="疫苗名称">
|
|
|
- <el-input v-model="formInline.user" placeholder="疫苗名称" clearable />
|
|
|
+ <el-form-item label="日期">
|
|
|
+ <el-date-picker v-model="data.datePicker" type="daterange" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
|
|
|
+ start-placeholder="开始时间" end-placeholder="结束时间" clearable style="width: 200px;" @change="changeTime"/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="生产企业">
|
|
|
- <el-select v-model="formInline.region" placeholder="生产企业" clearable>
|
|
|
- <el-option label="Zone one" value="shanghai" />
|
|
|
- <el-option label="Zone two" value="beijing" />
|
|
|
+ <el-form-item label="品种">
|
|
|
+ <el-select v-model="data.initParam.productId" placeholder="品种" clearable @clear="data.initParam.productId=null">
|
|
|
+ <el-option :label="item.name" :value="item.id" v-for="item,index in data.prodOptions" :key="index"/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="疫苗批号">
|
|
|
- <el-input v-model="formInline.user" placeholder="疫苗批号" clearable />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="疫苗效期">
|
|
|
- <el-date-picker v-model="formInline.date" type="date" placeholder="疫苗效期" clearable />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="出/入库日期">
|
|
|
- <el-date-picker v-model="formInline.date" type="date" placeholder="出/入库日期" clearable />
|
|
|
+ <el-form-item label="购货单位">
|
|
|
+ <el-select v-model="data.initParam.receivingUnit" filterable remote reserve-keyword placeholder="购货单位"
|
|
|
+ :remote-method="remoteMethod" :loading="loading">
|
|
|
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</searchAdd>
|
|
|
- <tables :requestApi="CompanyTree" :columns="columns" :initParam="initParam" :dataCallback="dataCallback">
|
|
|
- <template #right="{ row }">
|
|
|
- <el-button link type="primary" size="small">编辑</el-button>
|
|
|
- <el-button link type="success" size="small">权限</el-button>
|
|
|
- <el-button link type="danger" size="small">删除</el-button>
|
|
|
+ <bg istitle="基本信息">
|
|
|
+ <template #btn>
|
|
|
+ <el-button round type="primary" :icon="Download">导出销售清单</el-button>
|
|
|
+ <el-button round type="primary" :icon="Tickets">导出销售报表</el-button>
|
|
|
</template>
|
|
|
- <template #T_State="{ row }">
|
|
|
- <el-tag class="ml-2" v-if="row.T_State === 1">正常</el-tag>
|
|
|
- <el-tag class="ml-2" type="danger" v-else>离职</el-tag>
|
|
|
+ <template #bg>
|
|
|
+ <tables ref="TableRef" :requestApi="salesList" :columns="columns" :initParam="data.initParam"></tables>
|
|
|
</template>
|
|
|
- </tables>
|
|
|
+ </bg>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { reactive } from 'vue'
|
|
|
+import { reactive, ref, onMounted,nextTick} from 'vue'
|
|
|
+import { salesList,prodList,stockunit } from "@/api";
|
|
|
+import { Download, Tickets } from '@element-plus/icons-vue'
|
|
|
import tables from "@/components/table.vue";
|
|
|
import searchAdd from "@/components/searchAdd.vue";
|
|
|
+import bg from '@/components/bg.vue'
|
|
|
+const TableRef = ref()
|
|
|
|
|
|
+const loading = ref(false)
|
|
|
+interface ListItem {
|
|
|
+ value: string
|
|
|
+ label: string
|
|
|
+}
|
|
|
+const list = ref<ListItem[]>([])
|
|
|
+const options = ref<ListItem[]>([])
|
|
|
|
|
|
-import titles from '@/components/titles.vue'
|
|
|
-import { CompanyTree } from "@/api/index";
|
|
|
-const formInline = reactive({
|
|
|
- user: '',
|
|
|
- region: '',
|
|
|
- date: '',
|
|
|
+onMounted(async() => {
|
|
|
+ prodListApi()
|
|
|
+ const result:any = await stockunit({type:2,name:''})
|
|
|
+ list.value = result.data.list.map((item:any) => {
|
|
|
+ return { value: item, label: item}
|
|
|
+ })
|
|
|
})
|
|
|
+//品名
|
|
|
+const prodListApi = async ()=>{
|
|
|
+ const result:any = await prodList({"page": 1,"pageSize": 99999})
|
|
|
+ data.prodOptions = result.data.list
|
|
|
+}
|
|
|
+const remoteMethod = async(query: string) => {
|
|
|
+ if (query) {
|
|
|
+ loading.value = true
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.value = false
|
|
|
+ options.value = list.value.filter((item:any) => {
|
|
|
+ return item.label.toLowerCase().includes(query.toLowerCase())
|
|
|
+ })
|
|
|
+ }, 200)
|
|
|
+ } else {
|
|
|
+ options.value = []
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
// 渲染表格
|
|
|
const columns: any = [
|
|
|
- // { type: 'index', label: '#', width: 50, },
|
|
|
- { prop: 'T_D_name', label: '疫苗名称', width: 200 },
|
|
|
- { prop: 'T_sn', label: '生产企业', width: 200 },
|
|
|
- { prop: 'T_D_name', label: '批准文号', width: 200 },
|
|
|
- { prop: 'T_sn', label: '批签发合格编号', width: 200 },
|
|
|
-
|
|
|
- { prop: 'T_D_name', label: '规格(剂/支或粒)', width: 200 },
|
|
|
- { prop: 'T_sn', label: '生产日期', width: 200 },
|
|
|
- { prop: 'T_D_name', label: '疫苗批号', width: 200 },
|
|
|
- { prop: 'T_sn', label: '疫苗效期', width: 200 },
|
|
|
-
|
|
|
- { prop: 'T_D_name', label: '类型', width: 200 },
|
|
|
- { prop: 'T_sn', label: '收入数量', width: 200 },
|
|
|
- { prop: 'T_D_name', label: '发出数量', width: 200 },
|
|
|
- { prop: 'T_sn', label: '结余数量', width: 200 },
|
|
|
- { prop: 'T_D_name', label: '单位', width: 200 },
|
|
|
- { prop: 'T_sn', label: '剂型', width: 200 },
|
|
|
-
|
|
|
- { prop: 'T_D_name', label: '领苗人', width: 200 },
|
|
|
- { prop: 'T_sn', label: '发货单位', width: 200 },
|
|
|
- { prop: 'T_D_name', label: '收货单位', width: 200 },
|
|
|
- { prop: 'T_sn', label: '入/出库日期', width: 200 },
|
|
|
- { prop: 'operation', label: '操作', fixed: 'right', width: 200 }
|
|
|
-
|
|
|
- // { prop: 'T_State', label: '状态', name: 'T_State' },
|
|
|
+ { prop: 'date', label: '日期', width: 120 },
|
|
|
+ { prop: 'receiving_unit', label: '购货单位', width: 150 },
|
|
|
+ { prop: 'product_name', label: '品种', width: 150 },
|
|
|
+ { prop: 'enterprise_name', label: '生产企业', width: 150 },
|
|
|
+ { prop: 'spec_name', label: '规格(剂/支或粒)', width: 150 },
|
|
|
+ { prop: 'dosage_form_name', label: '剂型', width: 100 },
|
|
|
+ { prop: 'batch_number', label: '疫苗批号', width: 150 },
|
|
|
+ { prop: 'quantity', label: '数量', width: 70 },
|
|
|
+ { prop: 'unit_name', label: '单位', width: 70 },
|
|
|
+ { prop: 'purchase_unit_price', label: '购进单价', width: 100 },
|
|
|
+ { prop: 'purchase_money', label: '购进金额', width: 150 },
|
|
|
+ { prop: 'sales_unit_price', label: '销售单价', width: 100 },
|
|
|
+ { prop: 'sales_money', label: '销售金额', 'min-width': 150 },
|
|
|
+ // { prop: 'operation', label: '操作', fixed: 'right', width: 200 }
|
|
|
]
|
|
|
+
|
|
|
//请求参数
|
|
|
-const initParam = { T_name: '' }
|
|
|
+const data:any = reactive({
|
|
|
+ datePicker: [],//时间选择
|
|
|
+ prodOptions:[],
|
|
|
+ initParam: {
|
|
|
+ "endDate": "",
|
|
|
+ "startDate": "",
|
|
|
+ "productId":null,
|
|
|
+ "receivingUnit": ""
|
|
|
+ }
|
|
|
+})
|
|
|
|
|
|
//函数
|
|
|
-const dataCallback = async () => {
|
|
|
-
|
|
|
+const changeTime = async () => {
|
|
|
+ if(data.datePicker){data.initParam.startDate = data.datePicker[0];data.initParam.endDate = data.datePicker[1]}
|
|
|
+ else {data.initParam.startDate='';data.initParam.endDate = ''}
|
|
|
+ console.log('搜索',data)
|
|
|
+}
|
|
|
+//搜索
|
|
|
+const eventFun = async ()=>{
|
|
|
+ nextTick(() => {
|
|
|
+ TableRef.value?.getTableList()
|
|
|
+ })
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss">
|
|
|
/* @import url(); 引入css类 */
|
|
|
|
|
|
-.sellManage {
|
|
|
-}
|
|
|
+.sellManage {}
|
|
|
</style>
|