feat 到货单
This commit is contained in:
parent
e25b717c48
commit
3b49c37b07
@ -147,36 +147,3 @@ export function TransferIn(params: any) {
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
/********** 批次 **************/
|
||||
export function createDelivery(params: any) {
|
||||
return request({
|
||||
url: '/api/api/delivery/create',
|
||||
method: 'post',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
export function getReceiveList(params: any) {
|
||||
return request({
|
||||
url: '/api/api/delivery/getReceiveList',
|
||||
method: 'post',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
export function getStoreDetail(params: any) {
|
||||
return request({
|
||||
url: '/api/api/delivery/getStoreDetail',
|
||||
method: 'post',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
export function getReceiveDetail(params: any) {
|
||||
return request({
|
||||
url: '/api/api/delivery/getReceiveDetail',
|
||||
method: 'post',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
49
src/api/delivery/index.ts
Normal file
49
src/api/delivery/index.ts
Normal file
@ -0,0 +1,49 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
export function createDelivery(params: any) {
|
||||
return request({
|
||||
url: '/api/api/delivery/create',
|
||||
method: 'post',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
export function getReceiveList(params: any) {
|
||||
return request({
|
||||
url: '/api/api/delivery/getReceiveList',
|
||||
method: 'post',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
export function getStoreDetail(params: any) {
|
||||
return request({
|
||||
url: '/api/api/delivery/getStoreDetail',
|
||||
method: 'post',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
export function getReceiveDetail(params: any) {
|
||||
return request({
|
||||
url: '/api/api/delivery/getReceiveDetail',
|
||||
method: 'post',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
export function getDeliveryList(params: any) {
|
||||
return request({
|
||||
url: '/api/api/delivery/getDeliveryList',
|
||||
method: 'post',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
export function delDelivery(params: any) {
|
||||
return request({
|
||||
url: '/api/api/delivery/delDelivery',
|
||||
method: 'post',
|
||||
data: params,
|
||||
});
|
||||
}
|
@ -103,7 +103,7 @@
|
||||
import { getCurrentInstance, onMounted, reactive, ref, toRefs } from 'vue'
|
||||
import { ElForm, ElMessageBox, ElTable } from 'element-plus'
|
||||
import { localStorage } from '@/utils/storage'
|
||||
import { createDelivery, getReceiveList, getReceiveDetail } from '@/api/StockIn'
|
||||
import { createDelivery, getReceiveList, getReceiveDetail } from '@/api/delivery'
|
||||
import { getORG } from '@/api/auth'
|
||||
|
||||
const queryFormRef = ref(ElForm)
|
||||
@ -222,12 +222,9 @@ function handleCreate() {
|
||||
siteName: 'SDK',
|
||||
receiveList: state.receiveList
|
||||
}).then((res: any) => {
|
||||
if (res.success) {
|
||||
ElMessageBox.alert('创建到货单:' + name, '提醒框', {
|
||||
confirmButtonText: 'OK'
|
||||
}).then(() => {
|
||||
if (res.errorCode == 200) {
|
||||
proxy.$ElMessage.success(res.message)
|
||||
emits('refresh', name)
|
||||
})
|
||||
} else {
|
||||
proxy.$ElMessage.error(res.message)
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ export default {
|
||||
import { reactive, ref, onMounted, toRefs } from 'vue'
|
||||
import { ElForm, ElMessageBox, ElTable } from 'element-plus'
|
||||
import { getQueryList } from '@/api/common'
|
||||
import { getStoreDetail } from '@/api/StockIn'
|
||||
import { getStoreDetail } from '@/api/delivery'
|
||||
import { localStorage } from '@/utils/storage'
|
||||
import { areAllNotEmpty, msToDate } from '@/utils/CommonUtil'
|
||||
import {
|
||||
|
196
src/views/stockIn/deliveryNote/index.vue
Normal file
196
src/views/stockIn/deliveryNote/index.vue
Normal file
@ -0,0 +1,196 @@
|
||||
<template>
|
||||
<div class="vue-element-page-wrap" ref="tableContainer">
|
||||
<el-row class="page-search" justify="space-between" align="bottom">
|
||||
<el-form ref="queryFormRef" :model="queryParams.params" :inline="true" label-width="80px" label-position="left">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6" class="col_height">
|
||||
<el-form-item label="到货单类型" prop="deliveryType">
|
||||
<el-select filterable v-model="queryParams.params.deliveryType" placeholder="到货单类型">
|
||||
<el-option v-for="item in deliveryType" :key="item.key" :label="item.label" :value="item.key" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" class="col_height">
|
||||
<el-form-item label="到货单单号" prop="deliveryName">
|
||||
<el-Input v-model="queryParams.params.deliveryName" placeholder="输入到货单单号" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" class="col_height">
|
||||
<el-form-item label="到货单状态" prop="deliveryState">
|
||||
<el-select filterable v-model="queryParams.params.deliveryState" placeholder="到货单状态">
|
||||
<el-option v-for="item in deliveryState" :key="item.key" :label="item.label" :value="item.key" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div class="page-search-btns">
|
||||
<el-button type="primary" @click="queryInfo">搜索</el-button>
|
||||
<el-button @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</el-row>
|
||||
<!-- table 区域-->
|
||||
<div class="vue-element-page-table">
|
||||
<div class="page-table-operate">
|
||||
<div class="page-table-title">
|
||||
<div class="page-table-title-left">
|
||||
<span>到货单管理</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page-table-operateBtns">
|
||||
<el-popover :persistent="false" placement="right" popper-class="config-table-wrap" trigger="click">
|
||||
<template #reference>
|
||||
<el-button class="operateBtns-setting">
|
||||
<svg-icon icon-class="table_title" width="16px" height="16px" />
|
||||
</el-button>
|
||||
</template>
|
||||
<ConfigTable :list="tableConfig.column" @updateList="updateList" />
|
||||
</el-popover>
|
||||
</div>
|
||||
</div>
|
||||
<el-table :height="tableHeight" border v-loading="loading"
|
||||
:data="state.dataList" highlight-current-row row-key="id" style="width: 100%"
|
||||
@selection-change="handleSelection">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<template v-for="(col, index) in tableConfig.column" :key="index">
|
||||
<el-table-column v-if="!col.hide" :label="col.header" :prop="col.field" show-overflow-tooltip
|
||||
:sort-orders="['descending', 'ascending']" :sortable="true">
|
||||
<template #default="scope">
|
||||
<span v-if="col.field === 'deliveryType'">
|
||||
<span v-for="(item, index) in deliveryType" :key="index">
|
||||
<span v-if="item.key === scope.row[col.field]" >{{ item.label }}</span>
|
||||
</span>
|
||||
</span>
|
||||
<span v-else-if="col.field === 'deliveryState'">
|
||||
<span v-for="(item, index) in deliveryState" :key="index">
|
||||
<span v-if="item.key === scope.row[col.field]" >{{ item.label }}</span>
|
||||
</span>
|
||||
</span>
|
||||
<span v-else>{{ scope.row[col.field] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
|
||||
<el-table-column width="80" label="操作" align="center" class-name="table-operation" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button type="danger" link @click.stop="handleDel(scope.row)"> 删除 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination v-if="total > 0" :total="total" v-model:pageNumTo="queryParams.pageNum"
|
||||
v-model:pageSizeTo="queryParams.pageSize" @pagination="handleQuery" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'deliveryNote'
|
||||
}
|
||||
</script>
|
||||
<script lang="ts" setup>
|
||||
import { reactive, ref, onMounted, toRefs, getCurrentInstance } from 'vue'
|
||||
import { ElForm, ElMessageBox, ElTable } from 'element-plus'
|
||||
import { localStorage } from '@/utils/storage'
|
||||
import { bTableHeight } from '@/composables/calcTableHeight'
|
||||
import { getDeliveryList } from '@/api/delivery'
|
||||
import { delDelivery } from '@/api/delivery'
|
||||
// 公共变量
|
||||
const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableHeight(310)
|
||||
const { proxy }: any = getCurrentInstance()
|
||||
const tableConfig = ref({
|
||||
loading: false,
|
||||
column: [] as any,
|
||||
data: []
|
||||
})
|
||||
const queryFormRef = ref(ElForm)
|
||||
// 变量
|
||||
const state = reactive({
|
||||
dataList: [] as any, // 表格数据
|
||||
total: 0, // 总数
|
||||
selection: [] as any, // 多选
|
||||
loadings: false, // 更新按钮
|
||||
loading: true, // 表格
|
||||
// 到货单类型
|
||||
deliveryType: [{label: '批次到货单', key: '01'}, {label: '辅材到货单', key: '02'}],
|
||||
deliveryState: [{label: '新建', key: '01'}, {label: '结束', key: '02'}],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
params: {
|
||||
siteName: localStorage.get('siteName') || 'SDK',
|
||||
// 到货单名称
|
||||
deliveryName: '',
|
||||
// 到货单类
|
||||
deliveryType: '',
|
||||
// 到货单状态
|
||||
deliveryState: ''
|
||||
},
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
}
|
||||
})
|
||||
const { queryParams, total, loading, deliveryType, deliveryState } = toRefs(state)
|
||||
|
||||
// 加载
|
||||
onMounted(() => {
|
||||
tableConfig.value.column = [
|
||||
{ header: '工厂', field: 'siteName', hide: false },
|
||||
{ header: '到货单号', field: 'deliveryName', hide: false },
|
||||
{ header: '到货单类型', field: 'deliveryType', hide: false },
|
||||
{ header: '到货单状态', field: 'deliveryState', hide: false }
|
||||
]
|
||||
handleQuery()
|
||||
updateTableHeight()
|
||||
window.addEventListener('resize', handleResize)
|
||||
})
|
||||
// 搜索
|
||||
function queryInfo() {
|
||||
state.queryParams.pageNum = 1
|
||||
handleQuery()
|
||||
}
|
||||
// 表格事件
|
||||
const updateList = (col: any) => {
|
||||
tableConfig.value.column = col
|
||||
}
|
||||
// 多选
|
||||
const handleSelection = (val: any) => {
|
||||
state.selection = val
|
||||
}
|
||||
// 删除确认
|
||||
function handleDel(row: any) {
|
||||
ElMessageBox.confirm('确认删除?', '提示', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
distinguishCancelAndClose: true,
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
delDelivery(row).then((res: any) => {
|
||||
if (res.errorCode == 200) {
|
||||
proxy.$ElMessage.success(res.message)
|
||||
queryInfo()
|
||||
} else {
|
||||
proxy.$ElMessage.error(res.message)
|
||||
}
|
||||
})
|
||||
}).catch(() => {});
|
||||
}
|
||||
// 查询
|
||||
async function handleQuery() {
|
||||
state.loading = true
|
||||
await getDeliveryList(state.queryParams).then((res: any) => {
|
||||
state.dataList = res.resultObj.list
|
||||
state.total = res.resultObj.total
|
||||
state.loading = false
|
||||
})
|
||||
}
|
||||
// 重置
|
||||
function resetQuery() {
|
||||
queryFormRef.value.resetFields();
|
||||
handleQuery();
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.col_height {
|
||||
padding-top: 3.5px;
|
||||
padding-bottom: 3.5px;
|
||||
}
|
||||
</style>
|
Loading…
x
Reference in New Issue
Block a user