二级库报废申请列表 审核列表完善

This commit is contained in:
BianLzhaoMin 2025-01-22 18:08:55 +08:00
parent 0eb6b57d39
commit 9af71ec837
12 changed files with 1204 additions and 124 deletions

View File

@ -46,3 +46,27 @@ export function getScrapListApi(data) {
params: data,
})
}
// 二级库 报废申请
export function scrapAuditingApi(data) {
return request({
url: '/material/secondaryWarehouse/seconfScrap',
method: 'post',
data,
})
}
// 二级库 报废申请 详情
export function getSecondScrapListDetailsApi(data) {
return request({
url: '/material/secondaryWarehouse/getSecondScrapListDetails',
method: 'get',
params: data,
})
}
// 二级库 报废申请 审核
export function auditSeconfScrapApi(data) {
return request({
url: '/material/secondaryWarehouse/auditSeconfScrap',
method: 'post',
data,
})
}

View File

@ -41,3 +41,11 @@ export function getDevStockCountApi(data) {
params: data,
})
}
// 班组库存台账列表
// export function getDevStockCountApi(data) {
// return request({
// url: '/material/secondaryWarehouse/getList',
// method: 'get',
// params: data,
// })
// }

View File

@ -54,9 +54,9 @@
<el-option
v-for="item in configList"
filterable
:key="item.id"
:key="item.unitId"
:label="item.name"
:value="item.id"
:value="item.unitId"
>
</el-option>
</el-select>
@ -118,7 +118,7 @@
<el-table-column
label="计量单位"
align="center"
prop=""
prop="unitName"
show-overflow-tooltip
/>
<el-table-column

View File

@ -54,9 +54,9 @@
<el-option
v-for="item in configList"
filterable
:key="item.id"
:key="item.unitId"
:label="item.name"
:value="item.id"
:value="item.unitId"
>
</el-option>
</el-select>
@ -118,7 +118,7 @@
<el-table-column
label="计量单位"
align="center"
prop=""
prop="unitName"
show-overflow-tooltip
/>
<el-table-column

View File

@ -2,22 +2,28 @@
<div>
<PageHeader :pageContent="pageContent" @goBack="goBack" />
<el-form
ref="queryForm"
ref="queryFormRef"
size="small"
:inline="true"
:model="queryParams"
:rules="queryFormRules"
:model="scrapParams"
>
<el-form-item prop="keyword" label="二级库">
<el-select placeholder="请选择二级库" clearable>
<el-form-item prop="unitId" label="二级库">
<el-select
placeholder="请选择二级库"
clearable
v-model="scrapParams.unitId"
@change="onChangeScrap"
>
<el-option
v-for="item in unitList"
:key="item.id"
v-for="item in secondList"
:key="item.unitId"
:label="item.name"
:value="item.id"
:value="item.unitId"
/>
</el-select>
</el-form-item>
<el-form-item prop="keyword" label="规格型号">
<!-- <el-form-item prop="keyword" label="规格型号">
<el-select placeholder="请选择规格型号" clearable>
<el-option
v-for="item in unitList"
@ -26,11 +32,11 @@
:value="item.id"
/>
</el-select>
</el-form-item>
</el-form-item> -->
</el-form>
<el-row :gutter="8" class="mb8">
<el-col :span="1.5" :key="index">
<el-col :span="1.5">
<el-button
plain
size="mini"
@ -78,7 +84,7 @@
<el-table-column
label="库存数量"
align="center"
prop="num"
prop="stockNum"
show-overflow-tooltip
/>
<el-table-column label="报废数量" align="center">
@ -102,28 +108,125 @@
v-else
:min="0"
:precision="0"
:max="scope.row.num"
v-model="scope.row.outNum"
:max="scope.row.stockNum"
v-model="scope.row.scrapNum"
style="width: 120px"
placeholder="输入数量"
size="small"
/>
</template>
</el-table-column>
<el-table-column
label="报废原因"
align="center"
prop=""
show-overflow-tooltip
/>
<el-table-column label="报废原因" align="center">
<template slot-scope="{ row }">
<el-input
type="textarea"
:autosize="{ minRows: 2, maxRows: 6 }"
placeholder="请输入内容"
maxlength="100"
v-model="row.auditRemark"
show-word-limit
/>
</template>
</el-table-column>
</el-table>
<el-dialog
width="70%"
append-to-body
title="编码设备选择"
:close-on-click-modal="false"
:visible.sync="selectCodeVisible"
>
<el-table
border
:data="codeList"
@selection-change="handleSelectionChange"
>
<el-table-column
align="center"
label="序号"
type="index"
:index="
indexContinuation(
queryParams.pageNum,
queryParams.pageSize,
)
"
/>
<el-table-column
align="center"
width="55"
type="selection"
:selectable="
(row) => {
return row.maStatus == 16
}
"
/>
<el-table-column
prop="typeName"
align="center"
label="类型名称"
show-overflow-tooltip
/>
<el-table-column
label="规格型号"
align="center"
prop="modelName"
show-overflow-tooltip
/>
<el-table-column
label="设备编码"
align="center"
prop="maCode"
show-overflow-tooltip
/>
<el-table-column label="设备状态" align="center">
<template slot-scope="{ row }">
<el-tag
v-if="row.maStatus == 16"
type="success"
size="mini"
>
在库
</el-tag>
<el-tag
v-if="row.maStatus == 132"
type="warning"
size="mini"
>
在用
</el-tag>
</template>
</el-table-column>
</el-table>
<pagination
:total="dialogTotal"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getMaStatusByMaIdData()"
/>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="submitSelectCode()">
</el-button>
<el-button @click="onHandleCancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import PageHeader from '@/components/pageHeader'
import { getConfigListApi } from '@/api/claimAndRefund/config-pages.js'
import { secondaryWarehouseList } from '@/api/claimAndRefund/secondStore'
import {
scrapAuditingApi,
getMaStatusByMaIdApi,
} from '@/api/claimAndRefund/second-manage.js'
export default {
components: { PageHeader },
props: {
@ -138,13 +241,19 @@ export default {
typeList: [],
tableList: [],
total: 0,
dialogTotal: 0,
loading: false,
selectCodeVisible: false,
codeList: [],
pageContent: '报废申请',
secondList: [],
scrapParams: {
unitId: '',
},
queryParams: {
pageNum: 1,
pageSize: 10,
unitId: '',
},
currentIndex: 0,
queryCodeParams: {
@ -154,6 +263,15 @@ export default {
pageNum: 1,
pageSize: 10,
},
queryFormRules: {
unitId: [
{
required: true,
message: '请选择二级库',
trigger: 'change',
},
],
},
}
},
methods: {
@ -162,13 +280,74 @@ export default {
},
//
onHandleOutbound() {
this.$confirm('是否确认提交?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
// this.$confirm('', '', {
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'warning',
// })
// .then(async () => {})
// .catch(() => {})
this.$refs.queryFormRef.validate((valid) => {
if (valid) {
//
const isCode = this.tableList.some(
(e) => e.manageType == 0 && e.maCodeList.length > 0,
)
const isNum = this.tableList.some(
(e) => e.manageType == 1 && e.scrapNum > 0,
)
if (!isCode && !isNum) {
this.$modal.msgError('请操作需要退库的设备并设置数量')
return
}
this.$confirm('是否确认提交报废?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(async () => {
const params = {
unitId: this.scrapParams.unitId,
teamLeaseInfos: [],
}
Object.assign(params, this.outboundParams)
this.tableList.forEach((e) => {
if (
e.manageType == 0 &&
e.maCodeList.length > 0
) {
params.teamLeaseInfos.push({
auditRemark: e.auditRemark,
typeId: e.typeId,
id: e.id,
maIds: e.maCodeList
.map((i) => i.maId)
.join(','),
})
}
if (e.manageType == 1 && e.scrapNum > 0) {
params.teamLeaseInfos.push({
auditRemark: e.auditRemark,
id: e.id,
typeId: e.typeId,
outNum: e.scrapNum,
})
}
})
console.log(params, 'params参数')
const res = await scrapAuditingApi(params)
if (res.code === 200) {
this.$modal.msgSuccess('报废申请已提交')
this.$emit('openHomePage')
}
})
.catch(() => {})
}
})
.then(async () => {})
.catch(() => {})
},
getList() {
this.loading = true
@ -180,7 +359,8 @@ export default {
this.tableList = this.tableList.map((e) => {
return {
...e,
outNum: 0,
scrapNum: 0,
auditRemark: '',
maCodeList: [],
}
})
@ -197,10 +377,37 @@ export default {
async getMaStatusByMaIdData() {
const res = await getMaStatusByMaIdApi(this.queryCodeParams)
this.codeList = res.rows
this.dialogTotal = res.total
},
handleSelectionChange(list) {
this.tableList[this.currentIndex].maCodeList = list
},
submitSelectCode() {
if (this.tableList[this.currentIndex].maCodeList < 1) {
this.$modal.msgError('请选择需要出库的编码设备')
return
}
this.selectCodeVisible = false
},
onHandleCancel() {
this.tableList[this.currentIndex].maCodeList = []
this.selectCodeVisible = false
},
onChangeScrap(val) {
this.queryParams.unitId = val
this.getList()
},
async getSecondList() {
const { data: res } = await getConfigListApi({
pageNum: 1,
pageSize: 999,
})
this.secondList = res.rows
},
},
created() {
this.getList()
this.getSecondList()
},
}
</script>

View File

@ -25,12 +25,11 @@
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item prop="keyword">
<el-form-item prop="code">
<el-input
v-model="queryParams.keyword"
v-model="queryParams.code"
placeholder="请输入报废单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-col>
@ -73,7 +72,6 @@
<el-table v-loading="loading" :data="deviceList" border>
<el-table-column
align="center"
key="1"
label="序号"
type="index"
:index="
@ -82,47 +80,52 @@
/>
<el-table-column
label="机具名称"
label="报废单号"
align="center"
key="4"
prop="typeName"
prop="code"
show-overflow-tooltip
/>
<el-table-column
label="规格型号"
label="二级库名称"
align="center"
key="5"
prop="modelName"
prop="unitName"
show-overflow-tooltip
/>
<el-table-column
label="计量单位"
label="审批状态"
align="center"
key="6"
prop="nuitName"
prop="status"
show-overflow-tooltip
/>
>
<template slot-scope="{ row }">
<el-tag size="mini" type="primary" v-if="row.status == 0">
待审核
</el-tag>
<el-tag size="mini" type="success" v-if="row.status == 1">
已审核
</el-tag>
<el-tag size="mini" type="danger" v-if="row.status == 2">
驳回
</el-tag>
</template>
</el-table-column>
<el-table-column
label="库存总量"
label="审批时间"
align="center"
key="7"
prop="num"
show-overflow-tooltip
/>
<el-table-column
label="库存剩余量"
align="center"
key="8"
prop="stockNum"
show-overflow-tooltip
/>
<el-table-column
label="已领用数量"
align="center"
key="9"
prop="receiveNum"
prop="createTime"
show-overflow-tooltip
/>
<el-table-column label="操作" align="center">
<template slot-scope="{ row }">
<el-button
size="mini"
type="primary"
@click="onViewDetails(row)"
>
查看
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
@ -131,21 +134,80 @@
:limit.sync="queryParams.pageSize"
@pagination="getList()"
/>
<el-dialog
width="70%"
append-to-body
title="报废详情"
:close-on-click-modal="false"
:visible.sync="scrapDetailsVisible"
>
<el-table border :data="detailsList">
<el-table-column
align="center"
label="序号"
type="index"
:index="
indexContinuation(
queryParams.pageNum,
queryParams.pageSize,
)
"
/>
<el-table-column
prop="typeName"
align="center"
label="类型名称"
show-overflow-tooltip
/>
<el-table-column
label="规格型号"
align="center"
prop="modelName"
show-overflow-tooltip
/>
<el-table-column
label="设备编码"
align="center"
prop="maCode"
show-overflow-tooltip
/>
<el-table-column
label="报废数量"
align="center"
prop="scrapNum"
show-overflow-tooltip
/>
<el-table-column
label="报废原因"
align="center"
prop="auditRemark"
show-overflow-tooltip
/>
</el-table>
<pagination
:total="detailsTotal"
:page.sync="queryDetailsParams.pageNum"
:limit.sync="queryDetailsParams.pageSize"
@pagination="getScrapDetailsList()"
/>
</el-dialog>
</div>
</template>
<script>
import { getUnitData, getProData } from '@/api/claimAndRefund/receive.js'
import { secondaryWarehouseList } from '@/api/claimAndRefund/secondStore'
import { getTypeList } from '@/api/store/warehousing'
import { equipmentTypeTree } from '@/api/store/tools'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { getConfigListApi } from '@/api/claimAndRefund/config-pages.js'
import {
getScrapListApi,
getSecondScrapListDetailsApi,
} from '@/api/claimAndRefund/second-manage.js'
export default {
components: { Treeselect },
data() {
return {
total: 0,
detailsTotal: 0,
loading: false,
types: '变电二级库',
unitList: [],
@ -153,6 +215,8 @@ export default {
typeList: [],
equipmentTypeList: [],
deviceList: [],
detailsList: [],
scrapDetailsVisible: false,
handleBtnList: [
{ btn_title: '班组出库', btn_type: 1 },
{ btn_title: '班组退库', btn_type: 2 },
@ -161,78 +225,70 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
keyword: '',
unitId: undefined,
modelId: undefined,
typeId: undefined,
code: '',
},
queryDetailsParams: {
pageNum: 1,
pageSize: 10,
code: '',
},
}
},
methods: {
getList() {
this.loading = true
secondaryWarehouseList(this.queryParams).then((res) => {
getScrapListApi(this.queryParams).then((res) => {
this.deviceList = res.rows
this.total = res.total
this.loading = false
})
},
handleQuery() {},
resetQuery() {},
//
getUnitList() {
getUnitData().then((res) => {
this.unitList = res.data
})
handleQuery() {
this.getList()
},
//
getProList() {
getProData().then((response) => {
this.proList = response.data
})
resetQuery() {
this.resetForm('queryForm')
this.queryParams.unitId = ''
this.getList()
},
//
getTypeList() {
getTypeList({ level: '3' }).then((response) => {
this.typeList = response.data
})
},
//
equipmentType() {
equipmentTypeTree().then((response) => {
this.equipmentTypeList = response.data
this.equipmentTypeList.forEach((item, index) => {
if (item.children && item.children.length > 0) {
item.children.forEach((item2, index2) => {
if (item2.children && item2.children.length > 0) {
item2.children.forEach((item3) => {
if (
item3.children &&
item3.children.length > 0
) {
item3.children.forEach((item4) => {
item4.machineTypeName =
item3.typeName
item4.specificationType =
item4.typeName
this.$set(item4, 'purchasePrice', 0)
this.$set(item4, 'purchaseNum', 1)
})
}
})
}
})
}
})
async getSecondList() {
const { data: res } = await getConfigListApi({
pageNum: 1,
pageSize: 999,
})
this.unitList = res.rows
},
//
onClickSecond() {
this.$emit('onClickSecond')
},
//
onViewDetails(row) {
this.queryDetailsParams.code = row.code
this.getScrapDetailsList()
this.scrapDetailsVisible = true
},
async getScrapDetailsList() {
const res = await getSecondScrapListDetailsApi(
this.queryDetailsParams,
)
this.detailsList = res.rows
this.detailsTotal = res.total
// console.log(res, '')
},
//
onAuditing(row) {},
},
created() {
this.getList()
this.getSecondList()
},
created() {},
}
</script>

View File

@ -3,7 +3,7 @@
<div class="app-container">
<transition name="el-fade-in-linear">
<HomePages @onClickSecond="onClickSecond" v-if="isShowHome" />
<HandlePages @goBack="goBack" v-else />
<HandlePages @goBack="goBack" @openHomePage="openHomePage" v-else />
</transition>
</div>
</template>
@ -29,6 +29,9 @@ export default {
goBack() {
this.isShowHome = true
},
openHomePage() {
this.isShowHome = true
},
},
}
</script>

View File

@ -0,0 +1,413 @@
<template>
<div>
<PageHeader :pageContent="pageContent" @goBack="goBack" />
<el-form
ref="queryFormRef"
size="small"
:inline="true"
:rules="queryFormRules"
:model="scrapParams"
>
<el-form-item prop="unitId" label="二级库">
<el-select
placeholder="请选择二级库"
clearable
v-model="scrapParams.unitId"
@change="onChangeScrap"
>
<el-option
v-for="item in secondList"
:key="item.unitId"
:label="item.name"
:value="item.unitId"
/>
</el-select>
</el-form-item>
<!-- <el-form-item prop="keyword" label="规格型号">
<el-select placeholder="请选择规格型号" clearable>
<el-option
v-for="item in unitList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item> -->
</el-form>
<el-row :gutter="8" class="mb8">
<el-col :span="1.5">
<el-button
plain
size="mini"
type="primary"
@click="onHandleOutbound"
>
提交
</el-button>
</el-col>
</el-row>
<el-table border :data="tableList">
<el-table-column
align="center"
label="序号"
type="index"
:index="
indexContinuation(queryParams.pageNum, queryParams.pageSize)
"
/>
<el-table-column
prop="typeName"
align="center"
label="机具名称"
show-overflow-tooltip
/>
<el-table-column
label="规格型号"
align="center"
prop="modelName"
show-overflow-tooltip
/>
<!-- <el-table-column
label="设备编码"
align="center"
prop="unitName"
show-overflow-tooltip
/> -->
<el-table-column
label="计量单位"
align="center"
prop="nuitName"
show-overflow-tooltip
/>
<el-table-column
label="库存数量"
align="center"
prop="stockNum"
show-overflow-tooltip
/>
<el-table-column label="报废数量" align="center">
<template slot-scope="scope">
<template v-if="scope.row.manageType == 0">
<el-button
size="mini"
type="primary"
@click="onViewCode(scope.row.maIds, scope.$index)"
>
编码选择
{{
scope.row.maCodeList.length > 0
? `(${scope.row.maCodeList.length})`
: ''
}}
</el-button>
</template>
<el-input-number
v-else
:min="0"
:precision="0"
:max="scope.row.stockNum"
v-model="scope.row.scrapNum"
style="width: 120px"
placeholder="输入数量"
size="small"
/>
</template>
</el-table-column>
<el-table-column label="报废原因" align="center">
<template slot-scope="{ row }">
<el-input
type="textarea"
:autosize="{ minRows: 2, maxRows: 6 }"
placeholder="请输入内容"
maxlength="100"
v-model="row.auditRemark"
show-word-limit
/>
</template>
</el-table-column>
</el-table>
<el-dialog
width="70%"
append-to-body
title="编码设备选择"
:close-on-click-modal="false"
:visible.sync="selectCodeVisible"
>
<el-table
border
:data="codeList"
@selection-change="handleSelectionChange"
>
<el-table-column
align="center"
label="序号"
type="index"
:index="
indexContinuation(
queryParams.pageNum,
queryParams.pageSize,
)
"
/>
<el-table-column
align="center"
width="55"
type="selection"
:selectable="
(row) => {
return row.maStatus == 16
}
"
/>
<el-table-column
prop="typeName"
align="center"
label="类型名称"
show-overflow-tooltip
/>
<el-table-column
label="规格型号"
align="center"
prop="modelName"
show-overflow-tooltip
/>
<el-table-column
label="设备编码"
align="center"
prop="maCode"
show-overflow-tooltip
/>
<el-table-column label="设备状态" align="center">
<template slot-scope="{ row }">
<el-tag
v-if="row.maStatus == 16"
type="success"
size="mini"
>
在库
</el-tag>
<el-tag
v-if="row.maStatus == 132"
type="warning"
size="mini"
>
在用
</el-tag>
</template>
</el-table-column>
</el-table>
<pagination
:total="dialogTotal"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getMaStatusByMaIdData()"
/>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" @click="submitSelectCode()">
</el-button>
<el-button @click="onHandleCancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import PageHeader from '@/components/pageHeader'
import { getConfigListApi } from '@/api/claimAndRefund/config-pages.js'
import { secondaryWarehouseList } from '@/api/claimAndRefund/secondStore'
import {
scrapAuditingApi,
getMaStatusByMaIdApi,
} from '@/api/claimAndRefund/second-manage.js'
export default {
components: { PageHeader },
props: {
isHandleType: {
type: Number,
default: () => 1,
},
},
data() {
return {
unitList: [],
typeList: [],
tableList: [],
total: 0,
dialogTotal: 0,
loading: false,
selectCodeVisible: false,
codeList: [],
pageContent: '报废申请',
secondList: [],
scrapParams: {
unitId: '',
},
queryParams: {
pageNum: 1,
pageSize: 10,
unitId: '',
},
currentIndex: 0,
queryCodeParams: {
maCode: '',
maIds: '',
type: 1,
pageNum: 1,
pageSize: 10,
},
queryFormRules: {
unitId: [
{
required: true,
message: '请选择二级库',
trigger: 'change',
},
],
},
}
},
methods: {
goBack() {
this.$emit('goBack')
},
//
onHandleOutbound() {
// this.$confirm('', '', {
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'warning',
// })
// .then(async () => {})
// .catch(() => {})
this.$refs.queryFormRef.validate((valid) => {
if (valid) {
//
const isCode = this.tableList.some(
(e) => e.manageType == 0 && e.maCodeList.length > 0,
)
const isNum = this.tableList.some(
(e) => e.manageType == 1 && e.scrapNum > 0,
)
if (!isCode && !isNum) {
this.$modal.msgError('请操作需要退库的设备并设置数量')
return
}
this.$confirm('是否确认提交报废?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(async () => {
const params = {
unitId: this.scrapParams.unitId,
teamLeaseInfos: [],
}
Object.assign(params, this.outboundParams)
this.tableList.forEach((e) => {
if (
e.manageType == 0 &&
e.maCodeList.length > 0
) {
params.teamLeaseInfos.push({
auditRemark: e.auditRemark,
typeId: e.typeId,
id: e.id,
maIds: e.maCodeList
.map((i) => i.maId)
.join(','),
})
}
if (e.manageType == 1 && e.scrapNum > 0) {
params.teamLeaseInfos.push({
auditRemark: e.auditRemark,
id: e.id,
typeId: e.typeId,
outNum: e.scrapNum,
})
}
})
console.log(params, 'params参数')
const res = await scrapAuditingApi(params)
if (res.code === 200) {
this.$modal.msgSuccess('报废申请已提交')
this.$emit('openHomePage')
}
})
.catch(() => {})
}
})
},
getList() {
this.loading = true
secondaryWarehouseList(this.queryParams).then((res) => {
this.tableList = res.rows
this.total = res.total
this.loading = false
this.tableList = this.tableList.map((e) => {
return {
...e,
scrapNum: 0,
auditRemark: '',
maCodeList: [],
}
})
})
},
//
onViewCode(maIds, index) {
this.queryCodeParams.maIds = maIds
this.currentIndex = index
this.getMaStatusByMaIdData()
this.queryCodeParams.maCode = ''
this.selectCodeVisible = true
},
async getMaStatusByMaIdData() {
const res = await getMaStatusByMaIdApi(this.queryCodeParams)
this.codeList = res.rows
this.dialogTotal = res.total
},
handleSelectionChange(list) {
this.tableList[this.currentIndex].maCodeList = list
},
submitSelectCode() {
if (this.tableList[this.currentIndex].maCodeList < 1) {
this.$modal.msgError('请选择需要出库的编码设备')
return
}
this.selectCodeVisible = false
},
onHandleCancel() {
this.tableList[this.currentIndex].maCodeList = []
this.selectCodeVisible = false
},
onChangeScrap(val) {
this.queryParams.unitId = val
this.getList()
},
async getSecondList() {
const { data: res } = await getConfigListApi({
pageNum: 1,
pageSize: 999,
})
this.secondList = res.rows
},
},
created() {
this.getSecondList()
},
}
</script>

View File

@ -0,0 +1,331 @@
<template>
<div>
<el-form
ref="queryForm"
size="small"
:inline="true"
:model="queryParams"
>
<el-row>
<el-col :span="4">
<el-form-item prop="unitId">
<el-select
v-model="queryParams.unitId"
placeholder="请选择二级库"
clearable
>
<el-option
v-for="item in unitList"
filterable
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item prop="code">
<el-input
v-model="queryParams.code"
placeholder="请输入报废单号"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>
查询
</el-button>
<el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
>
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<!-- <el-row :gutter="8" class="mb8">
<el-col :span="1.5">
<el-button
plain
size="mini"
type="primary"
@click="onClickSecond()"
>
报废申请
</el-button>
</el-col>
</el-row> -->
<el-table v-loading="loading" :data="deviceList" border>
<el-table-column
align="center"
label="序号"
type="index"
:index="
indexContinuation(queryParams.pageNum, queryParams.pageSize)
"
/>
<el-table-column
label="报废单号"
align="center"
prop="code"
show-overflow-tooltip
/>
<el-table-column
label="二级库名称"
align="center"
prop="unitName"
show-overflow-tooltip
/>
<el-table-column
label="审批状态"
align="center"
prop="status"
show-overflow-tooltip
>
<template slot-scope="{ row }">
<el-tag size="mini" type="primary" v-if="row.status == 0">
待审核
</el-tag>
<el-tag size="mini" type="success" v-if="row.status == 1">
已审核
</el-tag>
<el-tag size="mini" type="danger" v-if="row.status == 2">
驳回
</el-tag>
</template>
</el-table-column>
<el-table-column
label="审批时间"
align="center"
prop="createTime"
show-overflow-tooltip
/>
<el-table-column label="操作" align="center">
<template slot-scope="{ row }">
<el-button
size="mini"
type="primary"
@click="onViewDetails(row)"
>
查看
</el-button>
<el-button
size="mini"
type="primary"
@click="onAuditing(row.code)"
v-if="row.status == 1"
>
审核
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList()"
/>
<el-dialog
width="70%"
append-to-body
title="报废详情"
:close-on-click-modal="false"
:visible.sync="scrapDetailsVisible"
>
<el-table border :data="detailsList">
<el-table-column
align="center"
label="序号"
type="index"
:index="
indexContinuation(
queryParams.pageNum,
queryParams.pageSize,
)
"
/>
<el-table-column
prop="typeName"
align="center"
label="类型名称"
show-overflow-tooltip
/>
<el-table-column
label="规格型号"
align="center"
prop="modelName"
show-overflow-tooltip
/>
<el-table-column
label="设备编码"
align="center"
prop="maCode"
show-overflow-tooltip
/>
<el-table-column
label="报废数量"
align="center"
prop="scrapNum"
show-overflow-tooltip
/>
<el-table-column
label="报废原因"
align="center"
prop="auditRemark"
show-overflow-tooltip
/>
</el-table>
<pagination
:total="detailsTotal"
:page.sync="queryDetailsParams.pageNum"
:limit.sync="queryDetailsParams.pageSize"
@pagination="getScrapDetailsList()"
/>
</el-dialog>
</div>
</template>
<script>
import { getConfigListApi } from '@/api/claimAndRefund/config-pages.js'
import {
getScrapListApi,
auditSeconfScrapApi,
getSecondScrapListDetailsApi,
} from '@/api/claimAndRefund/second-manage.js'
export default {
data() {
return {
total: 0,
detailsTotal: 0,
loading: false,
types: '变电二级库',
unitList: [],
proList: [],
typeList: [],
equipmentTypeList: [],
deviceList: [],
detailsList: [],
scrapDetailsVisible: false,
handleBtnList: [
{ btn_title: '班组出库', btn_type: 1 },
{ btn_title: '班组退库', btn_type: 2 },
{ btn_title: '二级库归还', btn_type: 3 },
],
queryParams: {
pageNum: 1,
pageSize: 10,
unitId: undefined,
code: '',
},
queryDetailsParams: {
pageNum: 1,
pageSize: 10,
code: '',
},
}
},
methods: {
getList() {
this.loading = true
getScrapListApi(this.queryParams).then((res) => {
this.deviceList = res.rows
this.total = res.total
this.loading = false
})
},
handleQuery() {
this.getList()
},
resetQuery() {
this.resetForm('queryForm')
this.queryParams.unitId = ''
this.getList()
},
async getSecondList() {
const { data: res } = await getConfigListApi({
pageNum: 1,
pageSize: 999,
})
this.unitList = res.rows
},
//
onClickSecond() {
this.$emit('onClickSecond')
},
//
onViewDetails(row) {
this.queryDetailsParams.code = row.code
this.getScrapDetailsList()
this.scrapDetailsVisible = true
},
async getScrapDetailsList() {
const res = await getSecondScrapListDetailsApi(
this.queryDetailsParams,
)
this.detailsList = res.rows
this.detailsTotal = res.total
// console.log(res, '')
},
onAuditing(code) {
this.$confirm('请确认审核结果?', '提示', {
confirmButtonText: '通过',
cancelButtonText: '驳回',
type: 'warning',
})
.then(async () => {
const res = await auditSeconfScrapApi({
status: 1,
code,
})
if (res.code === 200) {
this.$modal.msgSuccess('已审核')
}
})
.catch(async () => {
const res = await auditSeconfScrapApi({
status: 2,
code,
})
if (res.code === 200) {
this.$modal.msgSuccess('已审核')
}
})
.finally(() => {
this.getList()
})
},
},
created() {
this.getList()
this.getSecondList()
},
}
</script>
<style></style>

View File

@ -0,0 +1,37 @@
<template>
<!-- 二级库 管理 -->
<div class="app-container">
<transition name="el-fade-in-linear">
<HomePages @onClickSecond="onClickSecond" v-if="isShowHome" />
<HandlePages @goBack="goBack" @openHomePage="openHomePage" v-else />
</transition>
</div>
</template>
<script>
import HomePages from './components/home-pages'
import HandlePages from './components/handle-pages'
export default {
components: {
HomePages,
HandlePages,
},
data() {
return {
isShowHome: true,
isHandleType: 1,
}
},
methods: {
onClickSecond() {
this.isShowHome = false
},
goBack() {
this.isShowHome = true
},
openHomePage() {
this.isShowHome = true
},
},
}
</script>

View File

@ -204,7 +204,7 @@
<el-form-item label="设备编码:" prop="maCode">
<el-input
v-model="queryCodeParams.maCode"
placeholder="请输入班组名称"
placeholder="请输入设备编码"
/>
</el-form-item>
<el-form-item>

View File

@ -42,7 +42,8 @@ module.exports = {
// target: `https://test-cc.zhgkxt.com`,//线上环境-南网
// target: `https://z.csgmall.com.cn`,
target: `http://192.168.2.125:39080`, //超
// target: `http://192.168.2.125:39080`, //超
target: `http://192.168.2.122:39080`, //超
// target: `http://192.168.2.74:49080`, //旭/
// target: `http://192.168.2.17:39080`, //帅