|
|
@@ -2,27 +2,27 @@ |
|
|
|
<div class="page-home"> |
|
|
|
<div class="search-wrap" v-if="IsPermission(route, 'QUERY_BASE')"> |
|
|
|
<el-select clearable v-model="searchForm.inventoryType" style="width: 200px" placeholder="请选择设备类型"> |
|
|
|
<el-option v-for="item in inventoryTypeList" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
|
<el-option v-for="item in inventoryTypeList" :key="item.value" :label="item.label" :value="item.value"/> |
|
|
|
</el-select> |
|
|
|
<el-select clearable v-model="searchForm.brand" style="width: 260px" placeholder="请选择设备厂商(先选设备类型)"> |
|
|
|
<template v-slot="scope"> |
|
|
|
<span v-if="searchForm.inventoryType == 'CARD'"> |
|
|
|
<el-option v-for="item in cardManufacturerList" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
|
<el-option v-for="item in cardManufacturerList" :key="item.value" :label="item.label" :value="item.value"/> |
|
|
|
</span> |
|
|
|
<span v-if="searchForm.inventoryType == 'OBU'"> |
|
|
|
<el-option v-for="item in manufacturerList" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
|
<el-option v-for="item in manufacturerList" :key="item.value" :label="item.label" :value="item.value"/> |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
</el-select> |
|
|
|
<el-select clearable v-model="searchForm.version" style="width: 200px" placeholder="请选择设备型号"> |
|
|
|
<el-option v-for="item in modelList" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
|
<el-option v-for="item in modelList" :key="item.value" :label="item.label" :value="item.value"/> |
|
|
|
</el-select> |
|
|
|
<el-select clearable v-model="searchForm.applyStatus" style="width: 200px" placeholder="请选择申请状态"> |
|
|
|
<el-option v-for="item in resultList" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
|
<el-option v-for="item in resultList" :key="item.value" :label="item.label" :value="item.value"/> |
|
|
|
</el-select> |
|
|
|
<el-date-picker unlink-panels v-model="value1" type="daterange" range-separator="到" start-placeholder="开始日期" |
|
|
|
end-placeholder="结束日期" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" |
|
|
|
@change="dateChangeHandle" /> |
|
|
|
end-placeholder="结束日期" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" |
|
|
|
@change="dateChangeHandle"/> |
|
|
|
<el-button type="success" icon="search" @click="btnSearch"> |
|
|
|
搜索 |
|
|
|
</el-button> |
|
|
@@ -34,15 +34,15 @@ |
|
|
|
<el-button v-if="IsPermission(route, 'STORAGE_EQUIPMENT')" type="primary" @click="addHandle" icon="Plus"> |
|
|
|
设备入库-备货 |
|
|
|
</el-button> |
|
|
|
<el-button v-if="IsPermission(route, 'BATCH_CONFIRM_WAREHOUSEING')" type="success" @click="sureMoreHandle" |
|
|
|
v-loading="btnLoading"> |
|
|
|
<el-button v-if="IsPermission(route, 'CONFIRM_WAREHOUSEING')" type="success" @click="sureMoreHandle" |
|
|
|
v-loading="btnLoading"> |
|
|
|
批量确认入库 |
|
|
|
</el-button> |
|
|
|
</div> |
|
|
|
<div class="table-list"> |
|
|
|
<!-- table-layout="auto" --> |
|
|
|
<el-table :data="tableData" @selection-change="selectionChangeHandle" :border="true" row-key="id" |
|
|
|
v-loading="tableLoding" show-overflow-tooltip> |
|
|
|
v-loading="tableLoding" show-overflow-tooltip size="small"> |
|
|
|
<!-- <el-table-column type="expand"> |
|
|
|
<template #default="props"> |
|
|
|
<div class="table-wrap"> |
|
|
@@ -100,7 +100,7 @@ |
|
|
|
<!-- <el-table-column prop="agencyId" label="产权归属"></el-table-column> --> |
|
|
|
<el-table-column label="操作" width="340" fixed="right"> |
|
|
|
<template v-slot="scope"> |
|
|
|
<el-button type="primary" class="op-btn" @click="editHandle(scope.row)" v-if=" |
|
|
|
<el-button size="small" type="primary" class="op-btn" @click="editHandle(scope.row)" v-if=" |
|
|
|
// (scope.row.applyStatus === 'SUPPLY' || |
|
|
|
// scope.row.applyStatus === 'INSTORAGE') && |
|
|
|
(scope.row.applyStatus === 'NEW') && |
|
|
@@ -108,13 +108,13 @@ |
|
|
|
"> |
|
|
|
修改备货 |
|
|
|
</el-button> |
|
|
|
<el-button type="primary" class="op-btn" @click="deleteHandleShow(scope.row)" v-if=" |
|
|
|
<el-button size="small" type="primary" class="op-btn" @click="deleteHandleShow(scope.row)" v-if=" |
|
|
|
(scope.row.applyStatus === 'NEW') && |
|
|
|
IsPermission(route, 'DEL_STOCK_UP') |
|
|
|
"> |
|
|
|
取消备货 |
|
|
|
</el-button> |
|
|
|
<el-button type="primary" class="op-btn" @click="sureHandle(scope.row)" v-if=" |
|
|
|
<el-button size="small" type="primary" class="op-btn" @click="sureHandle(scope.row)" v-if=" |
|
|
|
(scope.row.applyStatus === 'NEW') && |
|
|
|
IsPermission(route, 'CONFIRM_WAREHOUSEING') |
|
|
|
"> |
|
|
@@ -124,7 +124,7 @@ |
|
|
|
scope.row.applyStatus === 'DONE' && |
|
|
|
IsPermission(route, 'INFO_LIST') |
|
|
|
" --> |
|
|
|
<el-button type="primary" class="op-btn" @click="viewHandle(scope.row)"> |
|
|
|
<el-button size="small" type="primary" class="op-btn" @click="viewHandle(scope.row)"> |
|
|
|
详情 |
|
|
|
</el-button> |
|
|
|
<!-- <el-button type="primary" class="op-btn" @click="restoreHandle(scope.row)" v-if=" |
|
|
@@ -139,11 +139,11 @@ |
|
|
|
</div> |
|
|
|
<div class="page-wrap"> |
|
|
|
<el-pagination :page-size="paging.pageSize" layout="prev, pager, next" :current-page="paging.currentPage" |
|
|
|
:total="paging.total" @size-change="pagesizeChangeHandle" @current-change="handleCurrentChange" /> |
|
|
|
:total="paging.total" @size-change="pagesizeChangeHandle" @current-change="handleCurrentChange"/> |
|
|
|
</div> |
|
|
|
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="80%" :show-close="false"> |
|
|
|
<AddOrUpdate :ref="(el) => (addUpdateRef = el)" @refreshDataList="getList" @closeHandle="handleClose" |
|
|
|
:device-type-list="typeList" :device-model-list="modelList" :manufacturer-list="manufacturerList" /> |
|
|
|
:device-type-list="typeList" :device-model-list="modelList" :manufacturer-list="manufacturerList"/> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog v-model="cancelOrderDialog" width="30%" title="取消订单"> |
|
|
|
<el-form ref="cancelOrderFormRef" :model="cancelOrderForm" :rules="{ |
|
|
@@ -153,7 +153,7 @@ |
|
|
|
}" label-width="80px"> |
|
|
|
<el-form-item label="取消原因" prop="cancelReason"> |
|
|
|
<el-input v-trim clearable type="textarea" rows="5" v-model="cancelOrderForm.cancelReason" |
|
|
|
:placeholder="`取消原因`" maxlength="200" show-word-limit></el-input> |
|
|
|
:placeholder="`取消原因`" maxlength="200" show-word-limit></el-input> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
</el-form> |
|
|
@@ -177,11 +177,11 @@ import { |
|
|
|
nextTick, |
|
|
|
computed, |
|
|
|
} from 'vue' |
|
|
|
import { ElNotification, ElMessage, ElCard, ElMessageBox } from 'element-plus' |
|
|
|
import {ElNotification, ElMessage, ElCard, ElMessageBox} from 'element-plus' |
|
|
|
import Cookies from 'js-cookie' |
|
|
|
import { useDebounce, getDictLabel } from '@/utils/utils' |
|
|
|
import {useDebounce, getDictLabel} from '@/utils/utils' |
|
|
|
import BaseService from '@/utils/baseService' |
|
|
|
import { IObject } from '@/types/interface' |
|
|
|
import {IObject} from '@/types/interface' |
|
|
|
import AddOrUpdate from './addOrUpdate.vue' |
|
|
|
import { |
|
|
|
queryApi, |
|
|
@@ -196,13 +196,13 @@ import { |
|
|
|
deviceModelApi, |
|
|
|
} from '@/api/inventoryControl/deviceApply' |
|
|
|
import $storeinitData from '@/store/initData' //引入tab vuex |
|
|
|
import { useRoute } from 'vue-router' |
|
|
|
import { IsPermission } from '@/router/routerUtil' |
|
|
|
import {useRoute} from 'vue-router' |
|
|
|
import {IsPermission} from '@/router/routerUtil' |
|
|
|
//或取路由传入过来的对象数据 |
|
|
|
const route = useRoute() |
|
|
|
const tableLoding = ref(false) |
|
|
|
const cancelOrderForm = ref({ |
|
|
|
cancelReason:'' |
|
|
|
cancelReason: '' |
|
|
|
}) |
|
|
|
const addUpdateRef = ref() |
|
|
|
const state = reactive({ |
|
|
@@ -244,22 +244,26 @@ const modelList = computed(() => { |
|
|
|
}) |
|
|
|
const resultList = computed(() => { |
|
|
|
return ( |
|
|
|
// $storeinitData.state.dictData['INITIAL_EQUIPMENT_PUT_STATUS_TYPE'] || [] |
|
|
|
$storeinitData.state.dictData['INV_APPLY_STATUS'] || [] |
|
|
|
// $storeinitData.state.dictData['INITIAL_EQUIPMENT_PUT_STATUS_TYPE'] || [] |
|
|
|
$storeinitData.state.dictData['INV_APPLY_STATUS'] || [] |
|
|
|
) |
|
|
|
}) |
|
|
|
const { tableData, searchForm, selectList, paging, btnLoading } = toRefs(state) |
|
|
|
const {tableData, searchForm, selectList, paging, btnLoading} = toRefs(state) |
|
|
|
|
|
|
|
function handleCurrentChange(val: number) { |
|
|
|
paging.value.currentPage = val |
|
|
|
getList() |
|
|
|
} |
|
|
|
|
|
|
|
// 搜索按钮 |
|
|
|
function btnSearch() { |
|
|
|
paging.value.currentPage = 1 |
|
|
|
getList() |
|
|
|
} |
|
|
|
|
|
|
|
const cancelOrderDialog = ref(false) |
|
|
|
const rowData = ref() |
|
|
|
|
|
|
|
function deleteHandleShow(row: any) { |
|
|
|
cancelOrderDialog.value = true |
|
|
|
rowData.value = row |
|
|
@@ -281,6 +285,7 @@ function getLowerList() { |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// 搜索重置 |
|
|
|
function refreshLeft() { |
|
|
|
paging.value.currentPage = 1 |
|
|
@@ -288,6 +293,7 @@ function refreshLeft() { |
|
|
|
value1.value = null |
|
|
|
getList() |
|
|
|
} |
|
|
|
|
|
|
|
//pagesize修改 |
|
|
|
function pagesizeChangeHandle(val: number) { |
|
|
|
paging.value.currentPage = 1 |
|
|
@@ -301,7 +307,7 @@ function getList() { |
|
|
|
pageNo: paging.value.currentPage, |
|
|
|
pageSize: paging.value.pageSize, |
|
|
|
} |
|
|
|
let searchFormList = { ...searchForm.value } |
|
|
|
let searchFormList = {...searchForm.value} |
|
|
|
for (let key in searchFormList) { |
|
|
|
if (searchFormList[key]) { |
|
|
|
params[key] = searchFormList[key] |
|
|
@@ -309,21 +315,22 @@ function getList() { |
|
|
|
} |
|
|
|
tableData.value = [] |
|
|
|
BaseService.postN('/invw/api/enterApply/page', params).then( |
|
|
|
(res: any) => { |
|
|
|
if (res && res.code === 0) { |
|
|
|
let bizContent = res.data |
|
|
|
let data = bizContent.result || [] |
|
|
|
tableData.value = data |
|
|
|
// console.log('bizContent12222', data, tableData.value) |
|
|
|
tableLoding.value = false |
|
|
|
paging.value.total = bizContent.totalCount |
|
|
|
} else { |
|
|
|
tableLoding.value = false |
|
|
|
ElMessage.error(res.message) |
|
|
|
(res: any) => { |
|
|
|
if (res && res.code === 0) { |
|
|
|
let bizContent = res.data |
|
|
|
let data = bizContent.result || [] |
|
|
|
tableData.value = data |
|
|
|
// console.log('bizContent12222', data, tableData.value) |
|
|
|
tableLoding.value = false |
|
|
|
paging.value.total = bizContent.totalCount |
|
|
|
} else { |
|
|
|
tableLoding.value = false |
|
|
|
ElMessage.error(res.message) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
function dateChangeHandle(val: any) { |
|
|
|
if (val) { |
|
|
|
searchForm.value.applyTimeStart = val[0] |
|
|
@@ -333,6 +340,7 @@ function dateChangeHandle(val: any) { |
|
|
|
searchForm.value.applyTimeEnd = '' |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 获取设备厂商 |
|
|
|
function getManufacturerList() { |
|
|
|
BaseService.postN('/invw/dict/businessmendict').then((res: any) => { |
|
|
@@ -352,6 +360,7 @@ function getManufacturerList() { |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
//获取设备类型 |
|
|
|
function getDeviceTypeList() { |
|
|
|
BaseService.postN('/invw/dict/devicetypedict').then((res: any) => { |
|
|
@@ -371,6 +380,7 @@ function getDeviceTypeList() { |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
//获取设备型号 |
|
|
|
function getDeviceModelList() { |
|
|
|
BaseService.postN('/invw/dict/deviceversiontypedict').then((res: any) => { |
|
|
@@ -390,6 +400,7 @@ function getDeviceModelList() { |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
//获取申领状态 |
|
|
|
function getStatus() { |
|
|
|
BaseService.postN('/invw/dict/inventorystatusdict').then((res: any) => { |
|
|
@@ -409,6 +420,7 @@ function getStatus() { |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// 设备入库-备货 |
|
|
|
function addHandle() { |
|
|
|
dialogVisible.value = true |
|
|
@@ -418,6 +430,7 @@ function addHandle() { |
|
|
|
addUpdateRef.value.init() |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// 修改设备入库-备货 |
|
|
|
function editHandle(row: IObject) { |
|
|
|
dialogVisible.value = true |
|
|
@@ -427,6 +440,7 @@ function editHandle(row: IObject) { |
|
|
|
addUpdateRef.value.init(row) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// 确认入库 |
|
|
|
function sureHandle(row: IObject) { |
|
|
|
dialogVisible.value = true |
|
|
@@ -436,6 +450,7 @@ function sureHandle(row: IObject) { |
|
|
|
addUpdateRef.value.init(row) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
//详情 |
|
|
|
function viewHandle(row: IObject) { |
|
|
|
dialogVisible.value = true |
|
|
@@ -445,6 +460,7 @@ function viewHandle(row: IObject) { |
|
|
|
addUpdateRef.value.init(row) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// 删除 |
|
|
|
function deleteHandle(row: IObject) { |
|
|
|
ElMessageBox.confirm('确定要取消备货么?', '', { |
|
|
@@ -452,23 +468,27 @@ function deleteHandle(row: IObject) { |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'error', |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
BaseService.postN('/invw/api/enterApply/cancel', { id: rowData.value.id, reason: cancelOrderForm.value.cancelReason }).then( |
|
|
|
(res: any) => { |
|
|
|
if (res && res.code === 0) { |
|
|
|
getList() |
|
|
|
cancelOrderDialog.value = false |
|
|
|
ElMessage.success('取消备货成功') |
|
|
|
} else { |
|
|
|
ElMessage.error(res.message) |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
console.log('取消') |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
BaseService.postN('/invw/api/enterApply/cancel', { |
|
|
|
id: rowData.value.id, |
|
|
|
reason: cancelOrderForm.value.cancelReason |
|
|
|
}).then( |
|
|
|
(res: any) => { |
|
|
|
if (res && res.code === 0) { |
|
|
|
getList() |
|
|
|
cancelOrderDialog.value = false |
|
|
|
ElMessage.success('取消备货成功') |
|
|
|
} else { |
|
|
|
ElMessage.error(res.message) |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
console.log('取消') |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// 恢复备货 |
|
|
|
function restoreHandle(row: IObject) { |
|
|
|
ElMessageBox.confirm('确定要恢复备货么?', '', { |
|
|
@@ -476,22 +496,23 @@ function restoreHandle(row: IObject) { |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'error', |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
BaseService.postN('/invw/inventory/inventoryback', { id: row.id }).then( |
|
|
|
(res: any) => { |
|
|
|
if (res && res.code === 0) { |
|
|
|
getList() |
|
|
|
ElMessage.success('恢复成功') |
|
|
|
} else { |
|
|
|
ElMessage.error(res.message) |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
console.log('====取消') |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
BaseService.postN('/invw/inventory/inventoryback', {id: row.id}).then( |
|
|
|
(res: any) => { |
|
|
|
if (res && res.code === 0) { |
|
|
|
getList() |
|
|
|
ElMessage.success('恢复成功') |
|
|
|
} else { |
|
|
|
ElMessage.error(res.message) |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
console.log('====取消') |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
//批量确认入库 |
|
|
|
function sureMoreHandle() { |
|
|
|
btnLoading.value = true |
|
|
@@ -502,26 +523,31 @@ function sureMoreHandle() { |
|
|
|
return |
|
|
|
} |
|
|
|
let ids = list.map((item) => item.id) |
|
|
|
BaseService.postN('/invw/api/enterApply/batchConfirm', { ids: ids }).then( |
|
|
|
(res: any) => { |
|
|
|
if (res && res.code === 0) { |
|
|
|
ElMessage.success(res.message) |
|
|
|
} else { |
|
|
|
ElMessage.error(res.message) |
|
|
|
BaseService.postN('/invw/api/enterApply/batchConfirm', {ids: ids}).then( |
|
|
|
(res: any) => { |
|
|
|
if (res && res.code === 0) { |
|
|
|
ElMessage.success(res.message) |
|
|
|
} else { |
|
|
|
ElMessage.error(res.message) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
).catch(() => { |
|
|
|
btnLoading.value = false; |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
// 关闭弹窗 |
|
|
|
function handleClose() { |
|
|
|
dialogVisible.value = false |
|
|
|
dialogTitle.value = '' |
|
|
|
typeDialog.value = '' |
|
|
|
} |
|
|
|
|
|
|
|
// 表格选中 |
|
|
|
function selectionChangeHandle(val: any) { |
|
|
|
selectList.value = val |
|
|
|
} |
|
|
|
|
|
|
|
const interfaceLowerListArr = ref([]); |
|
|
|
onMounted(() => { |
|
|
|
// getStatus(); |