diff --git a/.env.development b/.env.development index 9419bae..4a809a3 100644 --- a/.env.development +++ b/.env.development @@ -6,13 +6,13 @@ VITE_APP_ENV = 'development' # 开发环境 # 李陈杰 209 -# VITE_APP_BASE_API = 'http://192.168.110.209:8899' +VITE_APP_BASE_API = 'http://192.168.110.209:8899' # 曾涛 # VITE_APP_BASE_API = 'http://192.168.110.180:8899' # 罗成 # VITE_APP_BASE_API = 'http://192.168.110.188:8899' # 朱银 -VITE_APP_BASE_API = 'http://192.168.110.180:8899' +# VITE_APP_BASE_API = 'http://192.168.110.180:8899' #曾涛 # VITE_APP_BASE_API = 'http://192.168.110.171:8899' diff --git a/src/api/materials/materialOutbound/index.ts b/src/api/materials/materialOutbound/index.ts new file mode 100644 index 0000000..ca53c82 --- /dev/null +++ b/src/api/materials/materialOutbound/index.ts @@ -0,0 +1,27 @@ +import request from '@/utils/request'; + +//获取出库材料得列表 +export const outboundMaterials = (query?: any) => { + return request({ + url: '/materials/materials/listRelevancy', + method: 'get', + params: query + }); +}; +//新增出库 +export const addOutbound = (data?: any) => { + return request({ + url: '/materials/materialsInventory', + method: 'post', + data + }); +}; + +//获取材料列表 +export const getMaterialsList = (query?: any) => { + return request({ + url: '/materials/materials/list', + method: 'get', + params: query + }); +}; diff --git a/src/api/materials/materialsUseRecord/types.ts b/src/api/materials/materialsUseRecord/types.ts index 697f347..19df92b 100644 --- a/src/api/materials/materialsUseRecord/types.ts +++ b/src/api/materials/materialsUseRecord/types.ts @@ -33,7 +33,6 @@ export interface MaterialsUseRecordVO { * 备注 */ remark: string; - } export interface MaterialsUseRecordForm extends BaseEntity { @@ -71,11 +70,9 @@ export interface MaterialsUseRecordForm extends BaseEntity { * 备注 */ remark?: string; - } export interface MaterialsUseRecordQuery extends PageQuery { - /** * 项目ID */ @@ -101,11 +98,9 @@ export interface MaterialsUseRecordQuery extends PageQuery { */ residueNumber?: string | number; - /** - * 日期范围参数 - */ - params?: any; + /** + * 日期范围参数 + */ + params?: any; + materialsId?: string | number; } - - - diff --git a/src/views/materials/materialOutbound/component/outbound.vue b/src/views/materials/materialOutbound/component/outbound.vue new file mode 100644 index 0000000..c182cee --- /dev/null +++ b/src/views/materials/materialOutbound/component/outbound.vue @@ -0,0 +1,90 @@ + + + + + + + + {{ scope.row.residue }} + + + + + + {{ scope.row.number }} + + + + + + {{ scope.row.recipient }} + + + + + + {{ scope.row.shipper }} + + + + + + {{ scope.row.operator }} + + + + + + 确认 + + + + + + + diff --git a/src/views/materials/materialOutbound/index.vue b/src/views/materials/materialOutbound/index.vue new file mode 100644 index 0000000..91a54e3 --- /dev/null +++ b/src/views/materials/materialOutbound/index.vue @@ -0,0 +1,148 @@ + + + + + + + + + + + + 搜索 + 重置 + + + + + + + + { + // 阻止点击行时自动展开 + if (column.property) event.stopPropagation(); + } + " + :preserve-expanded-content="true" + > + + + + + + + + + + + + + + + + 新增出库 + + + + + + + + + + + + diff --git a/src/views/materials/materialsUseRecord/index.vue b/src/views/materials/materialsUseRecord/index.vue index 494f0a7..a8da5f4 100644 --- a/src/views/materials/materialsUseRecord/index.vue +++ b/src/views/materials/materialsUseRecord/index.vue @@ -1,84 +1,101 @@ - - - - - - - - - - 搜索 - 重置 - - - - - - - - - - - - - - - - - - - - 删除 - - - - - handleChildPagination(props.row.id, page, limit)" - /> - + + + + + + + + + + + + + + + + + + 搜索 + 重置 + + + + - - - - - - - - - - - - - 添加登记 - - - - - + + + + + + + + + + + + + + + 删除 + + + + + handleChildPagination(props.row.id, page, limit)" + /> + + + + + + + + + + + + + + + 添加登记 + + + + + + + + @@ -115,7 +132,7 @@ import { MaterialsUseRecordVO, MaterialsUseRecordQuery, MaterialsUseRecordForm } import { getCurrentInstance, ComponentInternalInstance, onMounted, ref, reactive, toRefs, computed, watch, WatchStopHandle } from 'vue'; import { ElFormInstance, ElTable } from 'element-plus'; import useUserStore from '@/store/modules/user'; -import { get } from 'lodash'; +import { getMaterialsList } from '@/api/materials/materialOutbound'; // 类型定义补充 interface DialogOption { @@ -183,7 +200,8 @@ const data = reactive({ projectId: currentProject.value?.id, outPut: 1, materialsName: undefined, - usePart: undefined + usePart: undefined, + materialsId: '' } as MaterialsUseRecordQuery & { outPut?: number; materialsName?: string; @@ -199,6 +217,32 @@ const data = reactive({ const { form, rules } = toRefs(data); const queryParams = ref({ ...data.queryParams }); +const TreeData: any = ref([]); +//获取材料列表 +const getMaterialsListData = async () => { + const res = await getMaterialsList({ projectId: currentProject.value?.id, pageNum: 1, pageSize: 999 }); + if (res.code === 200) { + // 将数据转换为树形结构 + TreeData.value = res.rows.map((item) => ({ + ...item, + label: item.materialsName + '_' + item.createTime, + children: [] + })); + queryParams.value.materialsId = TreeData.value[0].id; + getList(); + } +}; + +const handleNodeClick = (data: any) => { + console.log(data); + queryParams.value.materialsId = data.id; + getList(); +}; + +const defaultProps = { + children: 'children', + label: 'label' +}; // ------------------------------ 子列表状态工具函数 ------------------------------ /** 获取或初始化指定父行的子列表状态 */ @@ -420,6 +464,7 @@ onUnmounted(() => { // 页面挂载时加载数据 onMounted(() => { - getList(); + // getList(); + getMaterialsListData(); });