YangJian0701 1 anno fa
parent
commit
6093ce2c1d

+ 3 - 0
src/api/index.ts

@@ -1,4 +1,7 @@
 export * from './module/login'
 export * from './module/user'
 export * from './module/company'
+export * from './module/storageInquire'
+export * from './module/sellManage'
+
 

+ 4 - 1
src/api/module/company.ts

@@ -15,4 +15,7 @@ export const deleteTree = (params: any) => $http.delete('/dept', params)
 export const putTree = (params: any) => $http.put('/dept', params)
 
 // 公司列表树-进入
-export const postEnter = (params: any) => $http.post('/dept/enter', params)
+export const postEnter = (params: any) => $http.post('/dept/enter', params)
+
+// 添加子目录后初始化
+export const lateInit = (params: any) => $http.post('/medicine-template/init', params)

+ 14 - 0
src/api/module/sellManage.ts

@@ -0,0 +1,14 @@
+
+import $http from '@/utils/index'
+
+
+
+// 销售管理-列表
+export const salesList = (params: any) => $http.post('/sales/list', params)
+// 品种
+export const prodList = (params: any) => $http.post('/product/list', params)
+//购货单位
+export const stockunit = (params: any) => $http.post('/stock/unit/list', params)
+
+
+

+ 20 - 0
src/api/module/storageInquire.ts

@@ -0,0 +1,20 @@
+
+import $http from '@/utils/index'
+
+// 公司列表树
+export const stockList = (params: any) => $http.post('/stock-template/inventory/list', params)
+
+
+// 公司列表树-添加
+// export const postTree = (params: any) => $http.post('/dept', params)
+
+// // 公司列表树-删除
+// export const deleteTree = (params: any) => $http.delete('/dept', params)
+
+// // 公司列表树-编辑
+// export const putTree = (params: any) => $http.put('/dept', params)
+
+// // 公司列表树-进入
+// export const postEnter = (params: any) => $http.post('/dept/enter', params)
+
+

+ 1 - 1
src/hooks/useTable.ts

@@ -39,7 +39,7 @@ export const useTable = (
       // 当前页数
       pageNum: 1,
       // 每页显示条数
-      pageSize: 10,
+      pageSize: 2,
       // 总条数
       total: 0,
       RemainingTime: 0,

+ 13 - 9
src/utils/index.ts

@@ -3,7 +3,7 @@ import axios from 'axios'
 import type { AxiosInstance, AxiosError, AxiosRequestConfig, InternalAxiosRequestConfig, AxiosResponse } from 'axios'
 import { ElMessage, ElNotification } from 'element-plus'
 import { ResultEnum, ResultData, ContentType } from './interface/index'
-import {diffhost } from './diffhost/index'
+import { diffhost } from './diffhost/index'
 import { loadingFun, closeFun } from "@/plugins/loading";
 import router from '@/router/index'
 type LoadingType = {
@@ -13,7 +13,7 @@ let loadingInstance: LoadingType = {}
 const config = {
 	// 默认地址请求地址,可在 .env.*** 文件中修改
 	// baseURL: process.env.NODE_ENV ?(import.meta.env.VITE_BZD_ERP_APP_API as string) : '' ,
-	baseURL:process.env.VUE_APP_BASE_URL,
+	baseURL: process.env.VUE_APP_BASE_URL,
 	// 设置超时时间(10s)
 	timeout: ResultEnum.TIMEOUT as number,
 	// 跨域时候允许携带凭证
@@ -37,11 +37,11 @@ class RequestHttp {
 
 		this.service.interceptors.request.use((config: InternalAxiosRequestConfig) => {
 			loadingFun()
-			config.headers.Authorization = 'Bearer '+sessionStorage.getItem('token')
+			config.headers.Authorization = 'Bearer ' + sessionStorage.getItem('token')
 			const host = diffhost(config)
 			const url1 = process.env.VUE_APP_BASE_URL1
 			const url2 = process.env.VUE_APP_BASE_URL2
-			config.baseURL = host?url1 +'api':url2 +'api'
+			config.baseURL = host ? url1 + 'api' : url2 + 'api'
 			return config
 		},
 			(err: any) => err
@@ -61,7 +61,7 @@ class RequestHttp {
 				//   return Promise.reject(data)
 				// }
 				// * 登陆失效(code == 201)
-				
+
 				showStatus(data)
 				// * 全局错误信息拦截(防止下载文件得时候返回数据流,没有code,直接报错)
 				// if (data.Code && data.Code !== ResultEnum.SUCCESS) {
@@ -80,10 +80,14 @@ class RequestHttp {
 				return Promise.reject(error)
 			}
 		)
-		function showStatus(params:any) {
+		function showStatus(params: any) {
 			switch (params.code) {
 				case 200:
-					ElMessage.success(params.msg)
+					ElMessage({
+						showClose: true,
+						message: params.msg,
+						type: 'success',
+					})
 					break;
 				case ResultEnum.OVERDUE:
 					ElNotification.error({
@@ -115,14 +119,14 @@ class RequestHttp {
 	}
 	//放在请求体
 	delete<T>(url: string, params?: any, _object = {}): Promise<ResultData<T>> {
-		return this.service.delete(url,{ data:{...params}})
+		return this.service.delete(url, { data: { ...params } })
 	}
 	//拼接写法
 	// delete<T>(url: string, params?: any, _object = {}): Promise<ResultData<T>> {
 	// 	return this.service.delete(url,{params,..._object})
 	// }
 
-	
+
 }
 
 export default new RequestHttp(config)

+ 5 - 2
src/views/company/index.vue

@@ -52,7 +52,7 @@ import bg from '@/components/bg.vue'
 import { ElMessage, ElMessageBox, ElNotification } from 'element-plus'
 import searchAdd from "@/components/searchAdd.vue";
 import { reactive } from "vue";
-import { companyDept, postTree,deleteTree,putTree,postEnter } from "@/api";
+import { companyDept, postTree,deleteTree,putTree,postEnter,lateInit } from "@/api";
 import router from '@/router';
 import { useStore } from "vuex";
 const store = useStore()
@@ -93,7 +93,7 @@ const firstOrder = async () => {
 //添加目录Api
 const posTreeApi = async () => {
     const result:any = await postTree(datas.params)
-    if (result.code == 200 && result.msg == '创建成功') getDeptApi()
+    if (result.code == 200 && result.msg == '创建成功') lateInit({deptId:result.data});getDeptApi()
 }
 /**
  * 新增字节
@@ -136,6 +136,9 @@ const editFun = (node: any, data: any) => {
         ElMessage.info('取消编辑目录')
     })
 }
+
+
+
 /**
  * 删除
  */

+ 92 - 61
src/views/sellManage/index.vue

@@ -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>

+ 12 - 3
src/views/storageInquire/index.vue

@@ -31,7 +31,7 @@
                 <el-button round :icon="Tickets">打印</el-button>
             </template>
             <template #bg>
-                <tables :requestApi="CompanyTree" :columns="columns" :initParam="initParam">
+                <tables :requestApi="stockList" :columns="columns" :initParam="initParam">
                     <template #T_State="{ row }">
                         <div style="width: 10px;height: 10px;border-radius: 50%;background: red;"></div>
                     </template>
@@ -47,7 +47,7 @@
 
 <script setup lang="ts">
 import searchAdd from "@/components/searchAdd.vue";
-import { CompanyTree } from "@/api/index";
+import { stockList } from "@/api/index";
 import tables from "@/components/table.vue";
 import bg from '@/components/bg.vue'
 import { Download, Tickets } from '@element-plus/icons-vue'
@@ -82,7 +82,16 @@ const columns: any = [
     { prop: 'operation', label: '操作', fixed: 'right', 'min-width': 200 }
 ]
 //请求参数
-const initParam = { T_name: '' }
+const initParam = { 
+    "page": 1,
+    "pageSize": 10,
+    "batchNumber": "",
+    "enterpriseId": 0,
+    "endDate": "",
+    "startDate": "",
+    "productId": 1,
+    "sendReceiveUnit":"贵阳"
+}
 
 /**
  * 

+ 81 - 3
src/views/storageOrderGoods/index.vue

@@ -1,11 +1,89 @@
 <!--  -->
 <template>
-    <div class="">
-        销售订单
+    <div class="storageOrderGoods">
+        <searchAdd isButtom="查询" :inline="true" :labelWidth="labelWidth">
+            <template #searchConter>
+                <el-form-item label="疫苗名称" :label-width="labelWidth">
+                    <el-input v-model="formInline.user" placeholder="疫苗名称" clearable style="width: 150px;" />
+                </el-form-item>
+                <el-form-item label="生产企业" :label-width="labelWidth">
+                    <el-select v-model="formInline.region" placeholder="Activity zone" style="width: 150px;">
+                        <el-option label="Zone one" value="shanghai" />
+                        <el-option label="Zone two" value="beijing" />
+                    </el-select>
+                </el-form-item>
+                <el-form-item label="疫苗批号" :label-width="labelWidth">
+                    <el-input v-model="formInline.user" placeholder="疫苗批号" clearable style="width: 150px;" />
+                </el-form-item>
+                <el-form-item label="疫苗效期" :label-width="labelWidth">
+                    <el-date-picker v-model="formInline.date" type="date" placeholder="疫苗效期" clearable
+                        style="width: 150px;" />
+                </el-form-item>
+                <el-form-item label="出/入库日期" :label-width="labelWidth">
+                    <el-date-picker v-model="formInline.date" type="date" placeholder="出/入库日期" clearable
+                        style="width: 150px;" />
+                </el-form-item>
+            </template>
+        </searchAdd>
+        <bg istitle="库存统计列表">
+            <template #btn>
+                <el-button round :icon="Download">下载</el-button>
+            </template>
+            <template #bg>
+                <tables :requestApi="stockList" :columns="columns" :initParam="initParam">
+                    <template #T_State="{ row }">
+                        <div style="width: 10px;height: 10px;border-radius: 50%;background: red;"></div>
+                    </template>
+                    <template #right="{ row }">
+                        <el-button type="primary">编辑</el-button>
+                        <el-button type="danger">删除</el-button>
+                    </template>
+                </tables>
+            </template>
+        </bg>
     </div>
 </template>
 
-<script setup>
+<script setup lang="ts">
+import searchAdd from "@/components/searchAdd.vue";
+import { stockList } from "@/api/index";
+import tables from "@/components/table.vue";
+import bg from '@/components/bg.vue'
+import { reactive, ref } from "vue";
+import { Download } from '@element-plus/icons-vue'
+const labelWidth = ref('90px')
+const formInline = reactive({
+    user: '',
+    region: '',
+    date: '',
+})
+// 渲染表格
+const columns: any = [
+    { prop: 'T_D_name', label: '日期', width: 150 },
+    { prop: 'T_D_name', label: '品种', width: 150 },
+    { prop: 'T_D_name', label: '剂型', width: 150 },
+    { prop: 'T_D_name', label: '规格', width: 200, },
+    { prop: 'T_D_name', label: '生产企业', width: 150, },
+    { prop: 'T_D_name', label: '疫苗批号', width: 150 },
+    { prop: 'T_D_name', label: '效期', width: 150 },
+    { prop: 'T_D_name', label: '批准文号', width: 150 },
+    { prop: 'T_State', label: '数量', name: 'T_State', width: 80 },
+    { prop: 'T_D_name', label: '单位', width: 150 },
+    { prop: 'T_D_name', label: '销售单价', width: 150 },
+    { prop: 'T_D_name', label: '销售金额', width: 150 },
+    { prop: 'operation', label: '操作', fixed: 'right', 'min-width': 200 }
+]
+//请求参数
+const initParam = { 
+    "page": 1,
+    "pageSize": 10,
+    "batchNumber": "",
+    "enterpriseId": 0,
+    "endDate": "",
+    "startDate": "",
+    "productId": 1,
+    "sendReceiveUnit":""
+}
 </script>
 <style lang="scss">
 /* @import url(); 引入css类 */