Commit fb737ac7 by wuqian

基本页面搭建

parent 4a56b804
......@@ -33,6 +33,7 @@ declare module 'vue' {
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopover: typeof import('element-plus/es')['ElPopover']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow']
......@@ -57,6 +58,7 @@ declare module 'vue' {
SplitDiv: typeof import('./src/components/splitDiv/splitDiv.vue')['default']
TableRightMenu: typeof import('./src/components/TableRightMenu.vue')['default']
TableView: typeof import('./src/components/TableView.vue')['default']
UploadExcel: typeof import('./src/components/UploadExcel.vue')['default']
UploadImage: typeof import('./src/components/UploadImage.vue')['default']
WangEditor: typeof import('./src/components/WangEditor.vue')['default']
}
......
......@@ -97,7 +97,7 @@ export function deleteWarehouseInventory(ids: string) {
}
// 入库单
export function warehouseInRecordListPage(
export function warehouseInRecordListPageApi(
data: warehouseSearchForm,
currentPage: number,
pageSize: number,
......@@ -121,7 +121,7 @@ export function updateInRecordApi(form: InRecordEditForm) {
...form,
})
}
export function getWarehouseInRecordDetail(id: number) {
export function getWarehouseInRecordDetailApi(id: number) {
return axios.get<never, BaseRespData<never>>(
'factory/warehouseInRecord/get',
{
......@@ -131,7 +131,7 @@ export function getWarehouseInRecordDetail(id: number) {
},
)
}
export function getBySku(warehouseId: number, sku: string | null) {
export function getBySkuApi(warehouseId: number, sku: string | null) {
return axios.get<never, BaseRespData<InterskuList[]>>(
'customProductItem/getBySku',
{
......@@ -142,7 +142,7 @@ export function getBySku(warehouseId: number, sku: string | null) {
},
)
}
export function getByWareHouseIdAndCode(wareHouseId: number, code: string | null) {
export function getByWareHouseIdAndCodeApi(wareHouseId: number, code: string | null) {
return axios.get<never, BaseRespData<ILocation[]>>(
'factoryWarehouseLocation/getByWareHouseIdAndCode',
{
......@@ -153,7 +153,7 @@ export function getByWareHouseIdAndCode(wareHouseId: number, code: string | null
},
)
}
export function getWarehouseStatusTree() {
export function getInRecordStatusTree() {
return axios.get<never, BaseRespData<InterWarehouseTree[]>>(
'factory/warehouseInRecord/status_tree',
)
......@@ -163,3 +163,39 @@ export function getWarehouseListApi() {
'factoryWarehouseInfo/getAll',
)
}
export function deleteWarehouseInRecordApi(ids: string) {
return axios.get<never, BaseRespData<never>>(
'factory/warehouseInRecord/delete',
{
params: { ids },
},
)
}
// 出库单
export function getOutRecordStatusTree() {
return axios.get<never, BaseRespData<InterWarehouseTree[]>>(
'factory/warehouseOutRecord/status_tree',
)
}
export function warehouseOutRecordListPage(
data: warehouseSearchForm,
currentPage: number,
pageSize: number,
) {
return axios.post<never, BasePaginationData<InterWarehousePage>>(
'factory/warehouseOutRecord/list_page',
{
...data,
currentPage,
pageSize,
},
)
}
export function deleteWarehouseOutRecordApi(ids: string) {
return axios.get<never, BaseRespData<never>>(
'factory/warehouseOutRecord/delete',
{
params: { ids },
},
)
}
\ No newline at end of file
......@@ -99,7 +99,9 @@
<div class="btn-list">
<el-button type="primary" @click="addDialog(1)"> 新增 </el-button>
<el-button type="danger" @click="rejectOrder"> 驳回 </el-button>
<el-button type="danger" @click="rejectOrder"> 删除 </el-button>
<el-button type="danger" @click="handleBatchDelete">
删除
</el-button>
<el-button type="warning" @click="importExcel"> 导入 </el-button>
<el-button type="success" @click="exportExcel"> 导出 </el-button>
<el-button type="primary" @click="exportExcel">
......@@ -498,11 +500,11 @@
<template #default="{ row }">
<el-input
v-model.number="row.buyStored"
@input="setCostPrice(row)"
placeholder="入库数量"
style="width: 120px"
clearable
size="small"
@input="setCostPrice(row)"
></el-input>
</template>
</ElTableColumn>
......@@ -631,7 +633,7 @@
label="操作"
>
<template #default="{ row }">
<el-icon :size="32" color="#67C23A"
<el-icon :size="32" color="#67C23A" class="cursor-pointer"
><CirclePlusFilled @click="skudblclick(row)"
/></el-icon>
</template>
......@@ -705,14 +707,15 @@ import {
exportExcelApi,
} from '@/api/order'
import {
getWarehouseStatusTree,
warehouseInRecordListPage,
getWarehouseInRecordDetail,
getBySku,
getInRecordStatusTree,
warehouseInRecordListPageApi,
getWarehouseInRecordDetailApi,
getBySkuApi,
getWarehouseListApi,
getByWareHouseIdAndCode,
getByWareHouseIdAndCodeApi,
addInRecordApi,
updateInRecordApi,
deleteWarehouseInRecordApi,
} from '@/api/warehouse'
import BigNumber from 'bignumber.js'
import { ref, onMounted, watch, nextTick } from 'vue'
......@@ -851,12 +854,6 @@ function getStartTime() {
const day = date.getDate()
return `${year}-${month}-${day} 00:00:00`
}
interface Tree {
remark?: string
count?: number
code?: string
children?: Tree[]
}
const selectSku = ref('')
const treeData = ref<InterWarehouseTree[]>()
const [searchForm, resetSearchForm] = useValue<warehouseSearchForm>({})
......@@ -884,7 +881,7 @@ const {
onPageSizeChange: handleSizeChange,
} = usePageList({
query: (page, pageSize) =>
warehouseInRecordListPage(
warehouseInRecordListPageApi(
{
...searchForm.value,
// status: nodeId.value === -1 ? null : nodeId.value,
......@@ -907,7 +904,7 @@ const setCostPrice = (item: InterProductList) => {
}
const getTreeNum = async () => {
try {
const res = await getWarehouseStatusTree()
const res = await getInRecordStatusTree()
res.data = [{ code: -1, name: '全部', children: res.data }]
treeData.value = res.data
await nextTick(() => {
......@@ -939,7 +936,7 @@ const skuData = ref<InterskuList[]>([])
const selectbySku = async () => {
if (!editForm.value.warehouseId) return ElMessage.error('请选择仓库')
try {
const res = await getBySku(editForm.value.warehouseId, selectSku.value)
const res = await getBySkuApi(editForm.value.warehouseId, selectSku.value)
skuData.value = res.data || []
fetchLocationList('') //获取该仓库下的所有库位
} catch (e) {
......@@ -1039,7 +1036,6 @@ const addDialog = async (i: number, v: InterWarehousePage) => {
// get(url).then((res) => {
// if (res.code == 200) {
// otherPurchaseData.value = res.data;
// productData.value = res.data;
// } else {
// this.$alert(res.message, this.$t('错误提示'), {
// dangerouslyUseHTMLString: true,
......@@ -1050,9 +1046,9 @@ const addDialog = async (i: number, v: InterWarehousePage) => {
const handleSelectionChange = (v: InterWarehousePage[]) => {
selections.value = v
}
const productSelection = ref<InterProductList[]>([])
const otherWarehouseSelection = ref<InterProductList[]>([])
const productSelectionChange = (v: InterProductList[]) => {
productSelection.value = v
otherWarehouseSelection.value = v
}
const auditOrder = (key: string) => {
let url = ''
......@@ -1224,12 +1220,35 @@ const upSection = async () => {
console.error(e)
}
}
const addPurchase = async () => {}
const deleteOtherWarehousing = async () => {}
const addPurchase = async () => {
if (!editForm.value.warehouseId) return ElMessage.error('请选择仓库')
}
const deleteOtherWarehousing = () => {
const arr = otherWarehouseSelection.value
if (arr.length === 0) return
const idList = arr.map((v: InterProductList) => v.warehouseSku)
otherPurchaseData.value = otherPurchaseData.value.filter(
(item: InterProductList) => !idList.includes(item.warehouseSku),
)
}
const importData = async () => {
if (!editForm.value.warehouseId) return ElMessage.error('请选择仓库')
}
const nodeClick = (data: Tree) => {
const handleBatchDelete = async () => {
if (!selections.value.length) {
return ElMessage.warning('请选择要删除的数据')
}
await ElMessageBox.confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
const str = selections.value.map((el: InterWarehousePage) => el.id).join(',')
await deleteWarehouseInRecordApi(str)
ElMessage.success('删除成功')
await search()
}
const nodeClick = (data: InterWarehouseTree) => {
nodeId.value = data.code ?? ''
search()
}
......@@ -1240,7 +1259,7 @@ const detailPager = ref({
})
const searchDetail = async () => {
try {
const res = await getWarehouseInRecordDetail(currentRow.value?.id)
const res = await getWarehouseInRecordDetailApi(currentRow.value?.id)
detailList.value = res.data.records || []
detailPager.value.total = res.data.total
} catch (e) {
......@@ -1255,7 +1274,7 @@ const getLogList = async () => {
console.error(e)
}
}
const logisticsData = ref([])
// const logisticsData = ref([])
const getLogisticsData = async () => {
// try {
// const res = await getLogisticsDataApi(currentRow.value?.id)
......@@ -1298,7 +1317,10 @@ const fetchLocationList = async (query: string) => {
// }
locationLoading.value = true
try {
const res = await getByWareHouseIdAndCode(editForm.value.warehouseId, query)
const res = await getByWareHouseIdAndCodeApi(
editForm.value.warehouseId,
query,
)
const result = res.data || []
locationList.value = result.map((item: ILocation) => {
return {
......@@ -1332,6 +1354,9 @@ onMounted(() => {
width: 500px;
text-align: center;
}
.cursor-pointer {
cursor: pointer;
}
.header-filter-form {
:deep(.el-form-item) {
margin-right: 14px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment