提交
This commit is contained in:
@@ -133,4 +133,318 @@ export function delMaterialOut(outId) {
|
||||
url: '/system/engineering/material/out/' + outId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function listMaterialReturn(query) {
|
||||
return request({
|
||||
url: '/system/engineering/material/return/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getMaterialReturn(returnId) {
|
||||
return request({
|
||||
url: '/system/engineering/material/return/' + returnId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function addMaterialReturn(data) {
|
||||
return request({
|
||||
url: '/system/engineering/material/return',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateMaterialReturn(data) {
|
||||
return request({
|
||||
url: '/system/engineering/material/return',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function approveMaterialReturn(returnId) {
|
||||
return request({
|
||||
url: '/system/engineering/material/return/approve/' + returnId,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
||||
export function delMaterialReturn(returnId) {
|
||||
return request({
|
||||
url: '/system/engineering/material/return/' + returnId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function listMaterialPick(query) {
|
||||
return request({
|
||||
url: '/system/engineering/material/pick/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getMaterialPick(pickId) {
|
||||
return request({
|
||||
url: '/system/engineering/material/pick/' + pickId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function addMaterialPick(data) {
|
||||
return request({
|
||||
url: '/system/engineering/material/pick',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateMaterialPick(data) {
|
||||
return request({
|
||||
url: '/system/engineering/material/pick',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function approveMaterialPick(pickId) {
|
||||
return request({
|
||||
url: '/system/engineering/material/pick/approve/' + pickId,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
||||
export function issueMaterialPick(pickId) {
|
||||
return request({
|
||||
url: '/system/engineering/material/pick/issue/' + pickId,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
||||
export function delMaterialPick(pickId) {
|
||||
return request({
|
||||
url: '/system/engineering/material/pick/' + pickId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function listMaterialReturnBack(query) {
|
||||
return request({
|
||||
url: '/system/engineering/material/returnBack/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getMaterialReturnBack(returnBackId) {
|
||||
return request({
|
||||
url: '/system/engineering/material/returnBack/' + returnBackId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function addMaterialReturnBack(data) {
|
||||
return request({
|
||||
url: '/system/engineering/material/returnBack',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateMaterialReturnBack(data) {
|
||||
return request({
|
||||
url: '/system/engineering/material/returnBack',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function approveMaterialReturnBack(returnBackId) {
|
||||
return request({
|
||||
url: '/system/engineering/material/returnBack/approve/' + returnBackId,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
||||
export function delMaterialReturnBack(returnBackId) {
|
||||
return request({
|
||||
url: '/system/engineering/material/returnBack/' + returnBackId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function listMaterialTransfer(query) {
|
||||
return request({
|
||||
url: '/system/engineering/material/transfer/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getMaterialTransfer(transferId) {
|
||||
return request({
|
||||
url: '/system/engineering/material/transfer/' + transferId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function addMaterialTransfer(data) {
|
||||
return request({
|
||||
url: '/system/engineering/material/transfer',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateMaterialTransfer(data) {
|
||||
return request({
|
||||
url: '/system/engineering/material/transfer',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function approveMaterialTransfer(transferId) {
|
||||
return request({
|
||||
url: '/system/engineering/material/transfer/approve/' + transferId,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
||||
export function delMaterialTransfer(transferId) {
|
||||
return request({
|
||||
url: '/system/engineering/material/transfer/' + transferId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function listMaterialInventory(query) {
|
||||
return request({
|
||||
url: '/system/engineering/material/inventory/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getMaterialInventory(inventoryId) {
|
||||
return request({
|
||||
url: '/system/engineering/material/inventory/' + inventoryId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function addMaterialInventory(data) {
|
||||
return request({
|
||||
url: '/system/engineering/material/inventory',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateMaterialInventory(data) {
|
||||
return request({
|
||||
url: '/system/engineering/material/inventory',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function completeMaterialInventory(inventoryId) {
|
||||
return request({
|
||||
url: '/system/engineering/material/inventory/complete/' + inventoryId,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
||||
export function adjustMaterialInventory(inventoryId) {
|
||||
return request({
|
||||
url: '/system/engineering/material/inventory/adjust/' + inventoryId,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
||||
export function delMaterialInventory(inventoryId) {
|
||||
return request({
|
||||
url: '/system/engineering/material/inventory/' + inventoryId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function getMaterialInventoryDetail(inventoryId) {
|
||||
return request({
|
||||
url: '/system/engineering/material/inventory/detail/' + inventoryId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function addMaterialInventoryDetail(data) {
|
||||
return request({
|
||||
url: '/system/engineering/material/inventory/detail',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateMaterialInventoryDetail(data) {
|
||||
return request({
|
||||
url: '/system/engineering/material/inventory/detail',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function adjustMaterialInventoryDetail(detailId) {
|
||||
return request({
|
||||
url: '/system/engineering/material/inventory/detail/adjust/' + detailId,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
||||
export function listMaterialScrap(query) {
|
||||
return request({
|
||||
url: '/system/engineering/material/scrap/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getMaterialScrap(scrapId) {
|
||||
return request({
|
||||
url: '/system/engineering/material/scrap/' + scrapId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function addMaterialScrap(data) {
|
||||
return request({
|
||||
url: '/system/engineering/material/scrap',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateMaterialScrap(data) {
|
||||
return request({
|
||||
url: '/system/engineering/material/scrap',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function approveMaterialScrap(scrapId) {
|
||||
return request({
|
||||
url: '/system/engineering/material/scrap/approve/' + scrapId,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
||||
export function delMaterialScrap(scrapId) {
|
||||
return request({
|
||||
url: '/system/engineering/material/scrap/' + scrapId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -1,14 +1,21 @@
|
||||
<template>
|
||||
<el-image
|
||||
:src="`${realSrc}`"
|
||||
fit="cover"
|
||||
:style="`width:${realWidth};height:${realHeight};`"
|
||||
:preview-src-list="realSrcList"
|
||||
>
|
||||
<div slot="error" class="image-slot">
|
||||
<div class="image-preview-wrapper">
|
||||
<el-image
|
||||
v-if="realSrc"
|
||||
:src="realSrc"
|
||||
fit="cover"
|
||||
:style="imageStyle"
|
||||
:preview-src-list="realSrcList"
|
||||
@error="handleImageError"
|
||||
>
|
||||
<div slot="error" class="image-slot">
|
||||
<i class="el-icon-picture-outline"></i>
|
||||
</div>
|
||||
</el-image>
|
||||
<div v-else class="image-slot default">
|
||||
<i class="el-icon-picture-outline"></i>
|
||||
</div>
|
||||
</el-image>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -30,10 +37,15 @@ export default {
|
||||
default: ""
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
imageError: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
realSrc() {
|
||||
if (!this.src) {
|
||||
return
|
||||
return null
|
||||
}
|
||||
let real_src = this.src.split(",")[0]
|
||||
if (isExternal(real_src)) {
|
||||
@@ -43,23 +55,30 @@ export default {
|
||||
},
|
||||
realSrcList() {
|
||||
if (!this.src) {
|
||||
return
|
||||
return []
|
||||
}
|
||||
let real_src_list = this.src.split(",")
|
||||
let srcList = []
|
||||
real_src_list.forEach(item => {
|
||||
if (isExternal(item)) {
|
||||
return srcList.push(item)
|
||||
srcList.push(item)
|
||||
} else {
|
||||
srcList.push(process.env.VUE_APP_BASE_API + item)
|
||||
}
|
||||
return srcList.push(process.env.VUE_APP_BASE_API + item)
|
||||
})
|
||||
return srcList
|
||||
},
|
||||
realWidth() {
|
||||
return typeof this.width == "string" ? this.width : `${this.width}px`
|
||||
},
|
||||
realHeight() {
|
||||
return typeof this.height == "string" ? this.height : `${this.height}px`
|
||||
imageStyle() {
|
||||
return {
|
||||
width: typeof this.width === "string" ? this.width : `${this.width}px`,
|
||||
height: typeof this.height === "string" ? this.height : `${this.height}px`
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleImageError(e) {
|
||||
this.imageError = true
|
||||
console.warn("Image preview error:", e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open(row) {
|
||||
show(row) {
|
||||
this.open = true
|
||||
this.form = {
|
||||
constructionId: row.constructionId,
|
||||
|
||||
@@ -75,7 +75,7 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open(row) {
|
||||
show(row) {
|
||||
this.open = true
|
||||
this.title = row ? '修改施工节点' : '新增施工节点'
|
||||
this.form = row ? { ...row } : { progress: 0, status: 'in_progress', parentId: 0 }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" inline :label-width="100px">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" inline label-width="100px">
|
||||
<el-form-item label="合同" prop="contractId">
|
||||
<el-select v-model="queryParams.contractId" placeholder="请选择合同" clearable>
|
||||
<el-option v-for="contract in contractOptions" :key="contract.contractId" :label="contract.contractName" :value="contract.contractId" />
|
||||
|
||||
@@ -74,7 +74,7 @@ export default {
|
||||
this.supplierOptions = response.data
|
||||
})
|
||||
},
|
||||
open(row) {
|
||||
show(row) {
|
||||
this.open = true
|
||||
this.form = {
|
||||
contractId: null,
|
||||
|
||||
@@ -106,7 +106,7 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open(contractId) {
|
||||
show(contractId) {
|
||||
this.open = true
|
||||
getContractDetail(contractId).then(response => {
|
||||
this.detail = response.data
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" inline :label-width="100px">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" inline label-width="100px">
|
||||
<el-form-item label="合同编号" prop="contractNo">
|
||||
<el-input v-model="queryParams.contractNo" placeholder="请输入合同编号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
|
||||
420
ruoyi-ui/src/views/engineering/material/inventory.vue
Normal file
420
ruoyi-ui/src/views/engineering/material/inventory.vue
Normal file
@@ -0,0 +1,420 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="盘点单号" prop="inventoryNo">
|
||||
<el-input v-model="queryParams.inventoryNo" placeholder="请输入盘点单号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库" prop="warehouse">
|
||||
<el-input v-model="queryParams.warehouse" placeholder="请输入仓库" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
|
||||
<el-option label="待盘点" value="pending" />
|
||||
<el-option label="已完成" value="completed" />
|
||||
<el-option label="已调整" value="adjusted" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" @click="handleAdd">新增盘点单</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="inventoryList" border fit highlight-current-row>
|
||||
<el-table-column label="盘点单号" prop="inventoryNo" />
|
||||
<el-table-column label="仓库" prop="warehouse" />
|
||||
<el-table-column label="盘点日期" prop="inventoryDate" />
|
||||
<el-table-column label="盘点类型" prop="inventoryType">
|
||||
<template slot-scope="scope">
|
||||
<el-tag type="primary">{{ scope.row.inventoryType === 'full' ? '全面盘点' : '抽样盘点' }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.status === 'adjusted' ? 'success' : (scope.row.status === 'completed' ? 'primary' : 'warning')">
|
||||
{{ scope.row.status === 'adjusted' ? '已调整' : (scope.row.status === 'completed' ? '已完成' : '待盘点') }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime" />
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" icon="el-icon-edit" @click="handleEdit(scope.row)" v-if="scope.row.status === 'pending'">编辑</el-button>
|
||||
<el-button size="mini" icon="el-icon-check" type="success" @click="handleComplete(scope.row)" v-if="scope.row.status === 'pending'">完成盘点</el-button>
|
||||
<el-button size="mini" icon="el-icon-refresh" type="warning" @click="handleAdjust(scope.row)" v-if="scope.row.status === 'completed'">调整库存</el-button>
|
||||
<el-button size="mini" icon="el-icon-delete" type="danger" @click="handleDelete(scope.row)" v-if="scope.row.status !== 'adjusted'">删除</el-button>
|
||||
<el-button size="mini" icon="el-icon-list" @click="viewDetail(scope.row)">查看明细</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<el-dialog title="盘点单信息" :visible.sync="open" width="700px" append-to-body>
|
||||
<el-form :model="form" ref="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="盘点单号" prop="inventoryNo">
|
||||
<el-input v-model="form.inventoryNo" placeholder="请输入盘点单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="盘点日期" prop="inventoryDate">
|
||||
<el-date-picker v-model="form.inventoryDate" type="date" placeholder="请选择盘点日期" />
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库" prop="warehouse">
|
||||
<el-input v-model="form.warehouse" placeholder="请输入仓库" />
|
||||
</el-form-item>
|
||||
<el-form-item label="盘点类型" prop="inventoryType">
|
||||
<el-radio-group v-model="form.inventoryType">
|
||||
<el-radio label="full">全面盘点</el-radio>
|
||||
<el-radio label="partial">抽样盘点</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-textarea v-model="form.remark" placeholder="请输入备注" rows="3" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="盘点明细" :visible.sync="detailOpen" width="800px" append-to-body>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" @click="addDetail">新增明细</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table :data="detailList" border>
|
||||
<el-table-column label="物料" prop="materialName" />
|
||||
<el-table-column label="规格型号" prop="specification" />
|
||||
<el-table-column label="系统库存" prop="systemStock" />
|
||||
<el-table-column label="实际库存" prop="actualStock">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.actualStock" type="number" @change="updateDiff(scope.row)" v-if="currentInventory && currentInventory.status === 'pending'" />
|
||||
<span v-else>{{ scope.row.actualStock }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="差异数量" prop="diffQuantity">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.diffQuantity > 0 ? 'success' : (scope.row.diffQuantity < 0 ? 'danger' : '')">
|
||||
{{ scope.row.diffQuantity || 0 }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.status === 'adjusted' ? 'success' : 'warning'">
|
||||
{{ scope.row.status === 'adjusted' ? '已调整' : '待调整' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" icon="el-icon-edit" @click="editDetail(scope.row)" v-if="currentInventory && currentInventory.status === 'pending'">编辑</el-button>
|
||||
<el-button size="mini" icon="el-icon-check" type="success" @click="adjustDetail(scope.row)" v-if="scope.row.status === 'pending' && scope.row.diffQuantity !== 0">调整</el-button>
|
||||
<el-button size="mini" icon="el-icon-delete" type="danger" @click="deleteDetail(scope.row)" v-if="currentInventory && currentInventory.status === 'pending'">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="detailOpen = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="新增盘点明细" :visible.sync="detailFormOpen" width="600px" append-to-body>
|
||||
<el-form :model="detailForm" ref="detailForm" :rules="detailRules" label-width="100px">
|
||||
<el-form-item label="物料" prop="materialId">
|
||||
<el-select v-model="detailForm.materialId" placeholder="请选择物料">
|
||||
<el-option v-for="item in materialOptions" :key="item.materialId" :label="item.materialName + ' (' + item.materialCode + ') 库存:' + item.stock" :value="item.materialId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="系统库存" prop="systemStock">
|
||||
<el-input v-model="detailForm.systemStock" type="number" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="实际库存" prop="actualStock">
|
||||
<el-input v-model="detailForm.actualStock" type="number" placeholder="请输入实际库存" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-textarea v-model="detailForm.remark" placeholder="请输入备注" rows="3" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitDetail">确 定</el-button>
|
||||
<el-button @click="cancelDetail">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listMaterialInventory, getMaterialInventory, addMaterialInventory, updateMaterialInventory, completeMaterialInventory, adjustMaterialInventory, delMaterialInventory, getMaterialInventoryDetail, addMaterialInventoryDetail, updateMaterialInventoryDetail, adjustMaterialInventoryDetail } from '@/api/engineering/material'
|
||||
import { getMaterialOptions } from '@/api/engineering/material'
|
||||
|
||||
export default {
|
||||
name: 'MaterialInventory',
|
||||
data() {
|
||||
return {
|
||||
showSearch: true,
|
||||
loading: false,
|
||||
total: 0,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
inventoryNo: '',
|
||||
warehouse: '',
|
||||
status: ''
|
||||
},
|
||||
inventoryList: [],
|
||||
materialOptions: [],
|
||||
materialMap: {},
|
||||
open: false,
|
||||
detailOpen: false,
|
||||
detailFormOpen: false,
|
||||
form: {},
|
||||
detailList: [],
|
||||
detailForm: {},
|
||||
currentInventory: null,
|
||||
rules: {
|
||||
inventoryNo: [
|
||||
{ required: true, message: '盘点单号不能为空', trigger: 'blur' }
|
||||
],
|
||||
inventoryDate: [
|
||||
{ required: true, message: '盘点日期不能为空', trigger: 'change' }
|
||||
],
|
||||
warehouse: [
|
||||
{ required: true, message: '仓库不能为空', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
detailRules: {
|
||||
materialId: [
|
||||
{ required: true, message: '请选择物料', trigger: 'change' }
|
||||
],
|
||||
actualStock: [
|
||||
{ required: true, message: '实际库存不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
this.getOptions()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true
|
||||
listMaterialInventory(this.queryParams).then(response => {
|
||||
this.inventoryList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
getOptions() {
|
||||
getMaterialOptions().then(response => {
|
||||
this.materialOptions = response.data
|
||||
this.materialMap = {}
|
||||
response.data.forEach(item => {
|
||||
this.materialMap[item.materialId] = item
|
||||
})
|
||||
})
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
inventoryNo: '',
|
||||
warehouse: '',
|
||||
status: ''
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
handleAdd() {
|
||||
this.open = true
|
||||
this.form = { inventoryType: 'full' }
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.open = true
|
||||
getMaterialInventory(row.inventoryId).then(response => {
|
||||
this.form = response.data
|
||||
})
|
||||
},
|
||||
handleDelete(row) {
|
||||
this.$confirm('确定删除该盘点单吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delMaterialInventory(row.inventoryId).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('删除成功')
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
handleComplete(row) {
|
||||
this.$confirm('确定完成该盘点单吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
completeMaterialInventory(row.inventoryId).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('完成成功')
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
handleAdjust(row) {
|
||||
this.$confirm('确定调整库存吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
adjustMaterialInventory(row.inventoryId).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('调整成功')
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
viewDetail(row) {
|
||||
this.currentInventory = row
|
||||
this.detailOpen = true
|
||||
this.loadDetail(row.inventoryId)
|
||||
},
|
||||
loadDetail(inventoryId) {
|
||||
getMaterialInventoryDetail(inventoryId).then(response => {
|
||||
this.detailList = response.data || []
|
||||
})
|
||||
},
|
||||
addDetail() {
|
||||
this.detailForm = { inventoryId: this.currentInventory.inventoryId }
|
||||
this.detailFormOpen = true
|
||||
},
|
||||
editDetail(row) {
|
||||
this.detailForm = { ...row }
|
||||
this.detailFormOpen = true
|
||||
},
|
||||
deleteDetail(row) {
|
||||
this.$confirm('确定删除该明细吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.detailList = this.detailList.filter(item => item.detailId !== row.detailId)
|
||||
this.msgSuccess('删除成功')
|
||||
})
|
||||
},
|
||||
adjustDetail(row) {
|
||||
this.$confirm('确定调整该物料库存吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
adjustMaterialInventoryDetail(row.detailId).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('调整成功')
|
||||
this.loadDetail(this.currentInventory.inventoryId)
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
updateDiff(row) {
|
||||
if (row.systemStock !== undefined && row.actualStock !== undefined) {
|
||||
row.diffQuantity = (row.actualStock - row.systemStock) || 0
|
||||
}
|
||||
},
|
||||
submitDetail() {
|
||||
this.$refs['detailForm'].validate(valid => {
|
||||
if (valid) {
|
||||
const material = this.materialMap[this.detailForm.materialId]
|
||||
if (material) {
|
||||
this.detailForm.systemStock = material.stock
|
||||
this.detailForm.diffQuantity = (this.detailForm.actualStock - material.stock) || 0
|
||||
}
|
||||
|
||||
if (this.detailForm.detailId) {
|
||||
updateMaterialInventoryDetail(this.detailForm).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('修改成功')
|
||||
this.detailFormOpen = false
|
||||
this.loadDetail(this.currentInventory.inventoryId)
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
addMaterialInventoryDetail(this.detailForm).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('新增成功')
|
||||
this.detailFormOpen = false
|
||||
this.loadDetail(this.currentInventory.inventoryId)
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
cancelDetail() {
|
||||
this.detailFormOpen = false
|
||||
this.detailForm = {}
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.inventoryId) {
|
||||
updateMaterialInventory(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('修改成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
addMaterialInventory(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('新增成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.form = {}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
269
ruoyi-ui/src/views/engineering/material/pick.vue
Normal file
269
ruoyi-ui/src/views/engineering/material/pick.vue
Normal file
@@ -0,0 +1,269 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="领料单号" prop="pickNo">
|
||||
<el-input v-model="queryParams.pickNo" placeholder="请输入领料单号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="materialName">
|
||||
<el-input v-model="queryParams.materialName" placeholder="请输入物料名称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
|
||||
<el-option label="待审核" value="pending" />
|
||||
<el-option label="已审核" value="approved" />
|
||||
<el-option label="已发放" value="issued" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" @click="handleAdd">新增领料单</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="pickList" border fit highlight-current-row>
|
||||
<el-table-column label="领料单号" prop="pickNo" />
|
||||
<el-table-column label="物料" prop="materialName" />
|
||||
<el-table-column label="规格型号" prop="specification" />
|
||||
<el-table-column label="领料数量" prop="quantity" />
|
||||
<el-table-column label="领料日期" prop="pickDate" />
|
||||
<el-table-column label="领用部门" prop="deptName" />
|
||||
<el-table-column label="领用人" prop="receiver" />
|
||||
<el-table-column label="用途" prop="usePurpose" />
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.status === 'issued' ? 'success' : (scope.row.status === 'approved' ? 'primary' : 'warning')">
|
||||
{{ scope.row.status === 'issued' ? '已发放' : (scope.row.status === 'approved' ? '已审核' : '待审核') }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime" />
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" icon="el-icon-edit" @click="handleEdit(scope.row)" v-if="scope.row.status === 'pending'">编辑</el-button>
|
||||
<el-button size="mini" icon="el-icon-check" type="success" @click="handleApprove(scope.row)" v-if="scope.row.status === 'pending'">审核</el-button>
|
||||
<el-button size="mini" icon="el-icon-send" type="primary" @click="handleIssue(scope.row)" v-if="scope.row.status === 'approved'">发放</el-button>
|
||||
<el-button size="mini" icon="el-icon-delete" type="danger" @click="handleDelete(scope.row)" v-if="scope.row.status !== 'issued'">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<el-dialog title="领料单信息" :visible.sync="open" width="700px" append-to-body>
|
||||
<el-form :model="form" ref="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="领料单号" prop="pickNo">
|
||||
<el-input v-model="form.pickNo" placeholder="请输入领料单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料" prop="materialId">
|
||||
<el-select v-model="form.materialId" placeholder="请选择物料" @change="onMaterialChange">
|
||||
<el-option v-for="item in materialOptions" :key="item.materialId" :label="item.materialName + ' (' + item.materialCode + ') 库存:' + item.stock" :value="item.materialId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="领料数量" prop="quantity">
|
||||
<el-input v-model="form.quantity" type="number" placeholder="请输入领料数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="领料日期" prop="pickDate">
|
||||
<el-date-picker v-model="form.pickDate" type="date" placeholder="请选择领料日期" />
|
||||
</el-form-item>
|
||||
<el-form-item label="领用部门" prop="deptName">
|
||||
<el-input v-model="form.deptName" placeholder="请输入领用部门" />
|
||||
</el-form-item>
|
||||
<el-form-item label="领用人" prop="receiver">
|
||||
<el-input v-model="form.receiver" placeholder="请输入领用人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用途" prop="usePurpose">
|
||||
<el-textarea v-model="form.usePurpose" placeholder="请输入用途" rows="3" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-textarea v-model="form.remark" placeholder="请输入备注" rows="3" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listMaterialPick, getMaterialPick, addMaterialPick, updateMaterialPick, approveMaterialPick, issueMaterialPick, delMaterialPick } from '@/api/engineering/material'
|
||||
import { getMaterialOptions } from '@/api/engineering/material'
|
||||
|
||||
export default {
|
||||
name: 'MaterialPick',
|
||||
data() {
|
||||
return {
|
||||
showSearch: true,
|
||||
loading: false,
|
||||
total: 0,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pickNo: '',
|
||||
materialName: '',
|
||||
status: ''
|
||||
},
|
||||
pickList: [],
|
||||
materialOptions: [],
|
||||
open: false,
|
||||
form: {},
|
||||
rules: {
|
||||
pickNo: [
|
||||
{ required: true, message: '领料单号不能为空', trigger: 'blur' }
|
||||
],
|
||||
materialId: [
|
||||
{ required: true, message: '请选择物料', trigger: 'change' }
|
||||
],
|
||||
quantity: [
|
||||
{ required: true, message: '领料数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
pickDate: [
|
||||
{ required: true, message: '领料日期不能为空', trigger: 'change' }
|
||||
],
|
||||
deptName: [
|
||||
{ required: true, message: '领用部门不能为空', trigger: 'blur' }
|
||||
],
|
||||
receiver: [
|
||||
{ required: true, message: '领用人不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
this.getOptions()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true
|
||||
listMaterialPick(this.queryParams).then(response => {
|
||||
this.pickList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
getOptions() {
|
||||
getMaterialOptions().then(response => {
|
||||
this.materialOptions = response.data
|
||||
})
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pickNo: '',
|
||||
materialName: '',
|
||||
status: ''
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
handleAdd() {
|
||||
this.open = true
|
||||
this.form = {}
|
||||
this.getOptions()
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.open = true
|
||||
getMaterialPick(row.pickId).then(response => {
|
||||
this.form = response.data
|
||||
})
|
||||
},
|
||||
handleDelete(row) {
|
||||
this.$confirm('确定删除该领料单吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delMaterialPick(row.pickId).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('删除成功')
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
handleApprove(row) {
|
||||
this.$confirm('确定审核该领料单吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
approveMaterialPick(row.pickId).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('审核成功')
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
handleIssue(row) {
|
||||
this.$confirm('确定发放该领料单吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
issueMaterialPick(row.pickId).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('发放成功')
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
onMaterialChange() {
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.pickId) {
|
||||
updateMaterialPick(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('修改成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
addMaterialPick(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('新增成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.form = {}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
248
ruoyi-ui/src/views/engineering/material/return.vue
Normal file
248
ruoyi-ui/src/views/engineering/material/return.vue
Normal file
@@ -0,0 +1,248 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="退货单号" prop="returnNo">
|
||||
<el-input v-model="queryParams.returnNo" placeholder="请输入退货单号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="materialName">
|
||||
<el-input v-model="queryParams.materialName" placeholder="请输入物料名称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
|
||||
<el-option label="待审核" value="pending" />
|
||||
<el-option label="已审核" value="approved" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" @click="handleAdd">新增退货单</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="returnList" border fit highlight-current-row>
|
||||
<el-table-column label="退货单号" prop="returnNo" />
|
||||
<el-table-column label="物料" prop="materialName" />
|
||||
<el-table-column label="规格型号" prop="specification" />
|
||||
<el-table-column label="退货数量" prop="quantity" />
|
||||
<el-table-column label="退货日期" prop="returnDate" />
|
||||
<el-table-column label="供应商" prop="supplierName" />
|
||||
<el-table-column label="退货原因" prop="returnReason" />
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.status === 'approved' ? 'success' : 'warning'">
|
||||
{{ scope.row.status === 'approved' ? '已审核' : '待审核' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime" />
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" icon="el-icon-edit" @click="handleEdit(scope.row)" v-if="scope.row.status === 'pending'">编辑</el-button>
|
||||
<el-button size="mini" icon="el-icon-check" type="success" @click="handleApprove(scope.row)" v-if="scope.row.status === 'pending'">审核</el-button>
|
||||
<el-button size="mini" icon="el-icon-delete" type="danger" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<el-dialog title="退货单信息" :visible.sync="open" width="700px" append-to-body>
|
||||
<el-form :model="form" ref="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="退货单号" prop="returnNo">
|
||||
<el-input v-model="form.returnNo" placeholder="请输入退货单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料" prop="materialId">
|
||||
<el-select v-model="form.materialId" placeholder="请选择物料" @change="onMaterialChange">
|
||||
<el-option v-for="item in materialOptions" :key="item.materialId" :label="item.materialName + ' (' + item.materialCode + ')'" :value="item.materialId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="退货数量" prop="quantity">
|
||||
<el-input v-model="form.quantity" type="number" placeholder="请输入退货数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="退货日期" prop="returnDate">
|
||||
<el-date-picker v-model="form.returnDate" type="date" placeholder="请选择退货日期" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商" prop="supplierId">
|
||||
<el-select v-model="form.supplierId" placeholder="请选择供应商">
|
||||
<el-option v-for="item in supplierOptions" :key="item.supplierId" :label="item.supplierName" :value="item.supplierId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="退货原因" prop="returnReason">
|
||||
<el-textarea v-model="form.returnReason" placeholder="请输入退货原因" rows="3" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-textarea v-model="form.remark" placeholder="请输入备注" rows="3" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listMaterialReturn, getMaterialReturn, addMaterialReturn, updateMaterialReturn, approveMaterialReturn, delMaterialReturn } from '@/api/engineering/material'
|
||||
import { getMaterialOptions } from '@/api/engineering/material'
|
||||
import { getSupplierOptions } from '@/api/engineering/supplier'
|
||||
|
||||
export default {
|
||||
name: 'MaterialReturn',
|
||||
data() {
|
||||
return {
|
||||
showSearch: true,
|
||||
loading: false,
|
||||
total: 0,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
returnNo: '',
|
||||
materialName: '',
|
||||
status: ''
|
||||
},
|
||||
returnList: [],
|
||||
materialOptions: [],
|
||||
supplierOptions: [],
|
||||
open: false,
|
||||
form: {},
|
||||
rules: {
|
||||
returnNo: [
|
||||
{ required: true, message: '退货单号不能为空', trigger: 'blur' }
|
||||
],
|
||||
materialId: [
|
||||
{ required: true, message: '请选择物料', trigger: 'change' }
|
||||
],
|
||||
quantity: [
|
||||
{ required: true, message: '退货数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
returnDate: [
|
||||
{ required: true, message: '退货日期不能为空', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
this.getOptions()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true
|
||||
listMaterialReturn(this.queryParams).then(response => {
|
||||
this.returnList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
getOptions() {
|
||||
getMaterialOptions().then(response => {
|
||||
this.materialOptions = response.data
|
||||
})
|
||||
getSupplierOptions().then(response => {
|
||||
this.supplierOptions = response.data
|
||||
})
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
returnNo: '',
|
||||
materialName: '',
|
||||
status: ''
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
handleAdd() {
|
||||
this.open = true
|
||||
this.form = {}
|
||||
this.getOptions()
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.open = true
|
||||
getMaterialReturn(row.returnId).then(response => {
|
||||
this.form = response.data
|
||||
})
|
||||
},
|
||||
handleDelete(row) {
|
||||
this.$confirm('确定删除该退货单吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delMaterialReturn(row.returnId).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('删除成功')
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
handleApprove(row) {
|
||||
this.$confirm('确定审核该退货单吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
approveMaterialReturn(row.returnId).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('审核成功')
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
onMaterialChange() {
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.returnId) {
|
||||
updateMaterialReturn(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('修改成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
addMaterialReturn(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('新增成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.form = {}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
244
ruoyi-ui/src/views/engineering/material/returnBack.vue
Normal file
244
ruoyi-ui/src/views/engineering/material/returnBack.vue
Normal file
@@ -0,0 +1,244 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="还料单号" prop="returnBackNo">
|
||||
<el-input v-model="queryParams.returnBackNo" placeholder="请输入还料单号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="materialName">
|
||||
<el-input v-model="queryParams.materialName" placeholder="请输入物料名称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
|
||||
<el-option label="待审核" value="pending" />
|
||||
<el-option label="已审核" value="approved" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" @click="handleAdd">新增还料单</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="returnBackList" border fit highlight-current-row>
|
||||
<el-table-column label="还料单号" prop="returnBackNo" />
|
||||
<el-table-column label="关联领料单" prop="pickNo" />
|
||||
<el-table-column label="物料" prop="materialName" />
|
||||
<el-table-column label="规格型号" prop="specification" />
|
||||
<el-table-column label="还料数量" prop="quantity" />
|
||||
<el-table-column label="还料日期" prop="returnBackDate" />
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.status === 'approved' ? 'success' : 'warning'">
|
||||
{{ scope.row.status === 'approved' ? '已审核' : '待审核' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime" />
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" icon="el-icon-edit" @click="handleEdit(scope.row)" v-if="scope.row.status === 'pending'">编辑</el-button>
|
||||
<el-button size="mini" icon="el-icon-check" type="success" @click="handleApprove(scope.row)" v-if="scope.row.status === 'pending'">审核</el-button>
|
||||
<el-button size="mini" icon="el-icon-delete" type="danger" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<el-dialog title="还料单信息" :visible.sync="open" width="700px" append-to-body>
|
||||
<el-form :model="form" ref="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="还料单号" prop="returnBackNo">
|
||||
<el-input v-model="form.returnBackNo" placeholder="请输入还料单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="关联领料单" prop="pickId">
|
||||
<el-select v-model="form.pickId" placeholder="请选择关联领料单">
|
||||
<el-option v-for="item in pickOptions" :key="item.pickId" :label="item.pickNo" :value="item.pickId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料" prop="materialId">
|
||||
<el-select v-model="form.materialId" placeholder="请选择物料" @change="onMaterialChange">
|
||||
<el-option v-for="item in materialOptions" :key="item.materialId" :label="item.materialName + ' (' + item.materialCode + ')'" :value="item.materialId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="还料数量" prop="quantity">
|
||||
<el-input v-model="form.quantity" type="number" placeholder="请输入还料数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="还料日期" prop="returnBackDate">
|
||||
<el-date-picker v-model="form.returnBackDate" type="date" placeholder="请选择还料日期" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-textarea v-model="form.remark" placeholder="请输入备注" rows="3" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listMaterialReturnBack, getMaterialReturnBack, addMaterialReturnBack, updateMaterialReturnBack, approveMaterialReturnBack, delMaterialReturnBack } from '@/api/engineering/material'
|
||||
import { getMaterialOptions } from '@/api/engineering/material'
|
||||
import { listMaterialPick } from '@/api/engineering/material'
|
||||
|
||||
export default {
|
||||
name: 'MaterialReturnBack',
|
||||
data() {
|
||||
return {
|
||||
showSearch: true,
|
||||
loading: false,
|
||||
total: 0,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
returnBackNo: '',
|
||||
materialName: '',
|
||||
status: ''
|
||||
},
|
||||
returnBackList: [],
|
||||
materialOptions: [],
|
||||
pickOptions: [],
|
||||
open: false,
|
||||
form: {},
|
||||
rules: {
|
||||
returnBackNo: [
|
||||
{ required: true, message: '还料单号不能为空', trigger: 'blur' }
|
||||
],
|
||||
materialId: [
|
||||
{ required: true, message: '请选择物料', trigger: 'change' }
|
||||
],
|
||||
quantity: [
|
||||
{ required: true, message: '还料数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
returnBackDate: [
|
||||
{ required: true, message: '还料日期不能为空', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
this.getOptions()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true
|
||||
listMaterialReturnBack(this.queryParams).then(response => {
|
||||
this.returnBackList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
getOptions() {
|
||||
getMaterialOptions().then(response => {
|
||||
this.materialOptions = response.data
|
||||
})
|
||||
listMaterialPick({}).then(response => {
|
||||
this.pickOptions = response.rows || []
|
||||
})
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
returnBackNo: '',
|
||||
materialName: '',
|
||||
status: ''
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
handleAdd() {
|
||||
this.open = true
|
||||
this.form = {}
|
||||
this.getOptions()
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.open = true
|
||||
getMaterialReturnBack(row.returnBackId).then(response => {
|
||||
this.form = response.data
|
||||
})
|
||||
},
|
||||
handleDelete(row) {
|
||||
this.$confirm('确定删除该还料单吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delMaterialReturnBack(row.returnBackId).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('删除成功')
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
handleApprove(row) {
|
||||
this.$confirm('确定审核该还料单吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
approveMaterialReturnBack(row.returnBackId).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('审核成功')
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
onMaterialChange() {
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.returnBackId) {
|
||||
updateMaterialReturnBack(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('修改成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
addMaterialReturnBack(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('新增成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.form = {}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
272
ruoyi-ui/src/views/engineering/material/scrap.vue
Normal file
272
ruoyi-ui/src/views/engineering/material/scrap.vue
Normal file
@@ -0,0 +1,272 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="单据号" prop="scrapNo">
|
||||
<el-input v-model="queryParams.scrapNo" placeholder="请输入单据号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="materialName">
|
||||
<el-input v-model="queryParams.materialName" placeholder="请输入物料名称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="异常类型" prop="scrapType">
|
||||
<el-select v-model="queryParams.scrapType" placeholder="请选择异常类型" clearable>
|
||||
<el-option label="报损" value="scrap" />
|
||||
<el-option label="报溢" value="overflow" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
|
||||
<el-option label="待审核" value="pending" />
|
||||
<el-option label="已审核" value="approved" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" @click="handleAdd">新增报损报溢</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="scrapList" border fit highlight-current-row>
|
||||
<el-table-column label="单据号" prop="scrapNo" />
|
||||
<el-table-column label="物料" prop="materialName" />
|
||||
<el-table-column label="规格型号" prop="specification" />
|
||||
<el-table-column label="数量" prop="quantity" />
|
||||
<el-table-column label="异常类型" prop="scrapType">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.scrapType === 'scrap' ? 'danger' : 'success'">
|
||||
{{ scope.row.scrapType === 'scrap' ? '报损' : '报溢' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="异常日期" prop="scrapDate" />
|
||||
<el-table-column label="原因" prop="reason" />
|
||||
<el-table-column label="处理人" prop="handler" />
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.status === 'approved' ? 'success' : 'warning'">
|
||||
{{ scope.row.status === 'approved' ? '已审核' : '待审核' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime" />
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" icon="el-icon-edit" @click="handleEdit(scope.row)" v-if="scope.row.status === 'pending'">编辑</el-button>
|
||||
<el-button size="mini" icon="el-icon-check" type="success" @click="handleApprove(scope.row)" v-if="scope.row.status === 'pending'">审核</el-button>
|
||||
<el-button size="mini" icon="el-icon-delete" type="danger" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<el-dialog title="报损报溢信息" :visible.sync="open" width="700px" append-to-body>
|
||||
<el-form :model="form" ref="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="单据号" prop="scrapNo">
|
||||
<el-input v-model="form.scrapNo" placeholder="请输入单据号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料" prop="materialId">
|
||||
<el-select v-model="form.materialId" placeholder="请选择物料" @change="onMaterialChange">
|
||||
<el-option v-for="item in materialOptions" :key="item.materialId" :label="item.materialName + ' (' + item.materialCode + ') 库存:' + item.stock" :value="item.materialId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="数量" prop="quantity">
|
||||
<el-input v-model="form.quantity" type="number" placeholder="请输入数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="异常类型" prop="scrapType">
|
||||
<el-radio-group v-model="form.scrapType">
|
||||
<el-radio label="scrap">报损</el-radio>
|
||||
<el-radio label="overflow">报溢</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="异常日期" prop="scrapDate">
|
||||
<el-date-picker v-model="form.scrapDate" type="date" placeholder="请选择异常日期" />
|
||||
</el-form-item>
|
||||
<el-form-item label="原因" prop="reason">
|
||||
<el-textarea v-model="form.reason" placeholder="请输入异常原因" rows="3" />
|
||||
</el-form-item>
|
||||
<el-form-item label="处理人" prop="handler">
|
||||
<el-input v-model="form.handler" placeholder="请输入处理人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-textarea v-model="form.remark" placeholder="请输入备注" rows="3" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listMaterialScrap, getMaterialScrap, addMaterialScrap, updateMaterialScrap, approveMaterialScrap, delMaterialScrap } from '@/api/engineering/material'
|
||||
import { getMaterialOptions } from '@/api/engineering/material'
|
||||
|
||||
export default {
|
||||
name: 'MaterialScrap',
|
||||
data() {
|
||||
return {
|
||||
showSearch: true,
|
||||
loading: false,
|
||||
total: 0,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
scrapNo: '',
|
||||
materialName: '',
|
||||
scrapType: '',
|
||||
status: ''
|
||||
},
|
||||
scrapList: [],
|
||||
materialOptions: [],
|
||||
open: false,
|
||||
form: {},
|
||||
rules: {
|
||||
scrapNo: [
|
||||
{ required: true, message: '单据号不能为空', trigger: 'blur' }
|
||||
],
|
||||
materialId: [
|
||||
{ required: true, message: '请选择物料', trigger: 'change' }
|
||||
],
|
||||
quantity: [
|
||||
{ required: true, message: '数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
scrapType: [
|
||||
{ required: true, message: '请选择异常类型', trigger: 'change' }
|
||||
],
|
||||
scrapDate: [
|
||||
{ required: true, message: '异常日期不能为空', trigger: 'change' }
|
||||
],
|
||||
reason: [
|
||||
{ required: true, message: '原因不能为空', trigger: 'blur' }
|
||||
],
|
||||
handler: [
|
||||
{ required: true, message: '处理人不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
this.getOptions()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true
|
||||
listMaterialScrap(this.queryParams).then(response => {
|
||||
this.scrapList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
getOptions() {
|
||||
getMaterialOptions().then(response => {
|
||||
this.materialOptions = response.data
|
||||
})
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
scrapNo: '',
|
||||
materialName: '',
|
||||
scrapType: '',
|
||||
status: ''
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
handleAdd() {
|
||||
this.open = true
|
||||
this.form = {}
|
||||
this.getOptions()
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.open = true
|
||||
getMaterialScrap(row.scrapId).then(response => {
|
||||
this.form = response.data
|
||||
})
|
||||
},
|
||||
handleDelete(row) {
|
||||
this.$confirm('确定删除该报损报溢单吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delMaterialScrap(row.scrapId).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('删除成功')
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
handleApprove(row) {
|
||||
const typeText = row.scrapType === 'scrap' ? '报损' : '报溢'
|
||||
this.$confirm('确定审核该' + typeText + '单吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
approveMaterialScrap(row.scrapId).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('审核成功')
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
onMaterialChange() {
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.scrapId) {
|
||||
updateMaterialScrap(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('修改成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
addMaterialScrap(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('新增成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.form = {}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
271
ruoyi-ui/src/views/engineering/material/transfer.vue
Normal file
271
ruoyi-ui/src/views/engineering/material/transfer.vue
Normal file
@@ -0,0 +1,271 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="调拨单号" prop="transferNo">
|
||||
<el-input v-model="queryParams.transferNo" placeholder="请输入调拨单号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="materialName">
|
||||
<el-input v-model="queryParams.materialName" placeholder="请输入物料名称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="调拨类型" prop="transferType">
|
||||
<el-select v-model="queryParams.transferType" placeholder="请选择调拨类型" clearable>
|
||||
<el-option label="调拨出库" value="out" />
|
||||
<el-option label="调拨入库" value="in" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
|
||||
<el-option label="待审核" value="pending" />
|
||||
<el-option label="已审核" value="approved" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" @click="handleAdd">新增调拨单</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="transferList" border fit highlight-current-row>
|
||||
<el-table-column label="调拨单号" prop="transferNo" />
|
||||
<el-table-column label="物料" prop="materialName" />
|
||||
<el-table-column label="规格型号" prop="specification" />
|
||||
<el-table-column label="调拨数量" prop="quantity" />
|
||||
<el-table-column label="调出项目" prop="fromProject" />
|
||||
<el-table-column label="调入项目" prop="toProject" />
|
||||
<el-table-column label="调拨日期" prop="transferDate" />
|
||||
<el-table-column label="调拨类型" prop="transferType">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.transferType === 'out' ? 'warning' : 'success'">
|
||||
{{ scope.row.transferType === 'out' ? '调拨出库' : '调拨入库' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.status === 'approved' ? 'success' : 'warning'">
|
||||
{{ scope.row.status === 'approved' ? '已审核' : '待审核' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime" />
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" icon="el-icon-edit" @click="handleEdit(scope.row)" v-if="scope.row.status === 'pending'">编辑</el-button>
|
||||
<el-button size="mini" icon="el-icon-check" type="success" @click="handleApprove(scope.row)" v-if="scope.row.status === 'pending'">审核</el-button>
|
||||
<el-button size="mini" icon="el-icon-delete" type="danger" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<el-dialog title="调拨单信息" :visible.sync="open" width="700px" append-to-body>
|
||||
<el-form :model="form" ref="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="调拨单号" prop="transferNo">
|
||||
<el-input v-model="form.transferNo" placeholder="请输入调拨单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料" prop="materialId">
|
||||
<el-select v-model="form.materialId" placeholder="请选择物料" @change="onMaterialChange">
|
||||
<el-option v-for="item in materialOptions" :key="item.materialId" :label="item.materialName + ' (' + item.materialCode + ')'" :value="item.materialId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="调拨数量" prop="quantity">
|
||||
<el-input v-model="form.quantity" type="number" placeholder="请输入调拨数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="调出项目" prop="fromProject">
|
||||
<el-input v-model="form.fromProject" placeholder="请输入调出项目" />
|
||||
</el-form-item>
|
||||
<el-form-item label="调入项目" prop="toProject">
|
||||
<el-input v-model="form.toProject" placeholder="请输入调入项目" />
|
||||
</el-form-item>
|
||||
<el-form-item label="调拨日期" prop="transferDate">
|
||||
<el-date-picker v-model="form.transferDate" type="date" placeholder="请选择调拨日期" />
|
||||
</el-form-item>
|
||||
<el-form-item label="调拨类型" prop="transferType">
|
||||
<el-radio-group v-model="form.transferType">
|
||||
<el-radio label="out">调拨出库</el-radio>
|
||||
<el-radio label="in">调拨入库</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-textarea v-model="form.remark" placeholder="请输入备注" rows="3" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listMaterialTransfer, getMaterialTransfer, addMaterialTransfer, updateMaterialTransfer, approveMaterialTransfer, delMaterialTransfer } from '@/api/engineering/material'
|
||||
import { getMaterialOptions } from '@/api/engineering/material'
|
||||
|
||||
export default {
|
||||
name: 'MaterialTransfer',
|
||||
data() {
|
||||
return {
|
||||
showSearch: true,
|
||||
loading: false,
|
||||
total: 0,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
transferNo: '',
|
||||
materialName: '',
|
||||
transferType: '',
|
||||
status: ''
|
||||
},
|
||||
transferList: [],
|
||||
materialOptions: [],
|
||||
open: false,
|
||||
form: {},
|
||||
rules: {
|
||||
transferNo: [
|
||||
{ required: true, message: '调拨单号不能为空', trigger: 'blur' }
|
||||
],
|
||||
materialId: [
|
||||
{ required: true, message: '请选择物料', trigger: 'change' }
|
||||
],
|
||||
quantity: [
|
||||
{ required: true, message: '调拨数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
fromProject: [
|
||||
{ required: true, message: '调出项目不能为空', trigger: 'blur' }
|
||||
],
|
||||
toProject: [
|
||||
{ required: true, message: '调入项目不能为空', trigger: 'blur' }
|
||||
],
|
||||
transferDate: [
|
||||
{ required: true, message: '调拨日期不能为空', trigger: 'change' }
|
||||
],
|
||||
transferType: [
|
||||
{ required: true, message: '请选择调拨类型', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
this.getOptions()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true
|
||||
listMaterialTransfer(this.queryParams).then(response => {
|
||||
this.transferList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
getOptions() {
|
||||
getMaterialOptions().then(response => {
|
||||
this.materialOptions = response.data
|
||||
})
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
transferNo: '',
|
||||
materialName: '',
|
||||
transferType: '',
|
||||
status: ''
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
handleAdd() {
|
||||
this.open = true
|
||||
this.form = {}
|
||||
this.getOptions()
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.open = true
|
||||
getMaterialTransfer(row.transferId).then(response => {
|
||||
this.form = response.data
|
||||
})
|
||||
},
|
||||
handleDelete(row) {
|
||||
this.$confirm('确定删除该调拨单吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delMaterialTransfer(row.transferId).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('删除成功')
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
handleApprove(row) {
|
||||
this.$confirm('确定审核该调拨单吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
approveMaterialTransfer(row.transferId).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('审核成功')
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
onMaterialChange() {
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.transferId) {
|
||||
updateMaterialTransfer(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('修改成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
addMaterialTransfer(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess('新增成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.form = {}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@@ -80,7 +80,7 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open(row) {
|
||||
show(row) {
|
||||
this.open = true
|
||||
this.form = {
|
||||
supplierId: null,
|
||||
|
||||
@@ -1,61 +1,65 @@
|
||||
<template>
|
||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
||||
<div v-if="detail">
|
||||
<div v-if="loading" class="text-center">
|
||||
<el-loading-spinner></el-loading-spinner>
|
||||
<p>加载中...</p>
|
||||
</div>
|
||||
<div v-else-if="detail && detail.supplier">
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="基本信息">
|
||||
<el-form :model="detail.supplier" label-width="120px" class="detail-form">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供应商编号">
|
||||
<span>{{ detail.supplier.supplierCode }}</span>
|
||||
<span>{{ detail.supplier.supplierCode || '-' }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供应商名称">
|
||||
<span>{{ detail.supplier.supplierName }}</span>
|
||||
<span>{{ detail.supplier.supplierName || '-' }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="简称">
|
||||
<span>{{ detail.supplier.shortName }}</span>
|
||||
<span>{{ detail.supplier.shortName || '-' }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系人">
|
||||
<span>{{ detail.supplier.contactPerson }}</span>
|
||||
<span>{{ detail.supplier.contactPerson || '-' }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话">
|
||||
<span>{{ detail.supplier.contactPhone }}</span>
|
||||
<span>{{ detail.supplier.contactPhone || '-' }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱">
|
||||
<span>{{ detail.supplier.email }}</span>
|
||||
<span>{{ detail.supplier.email || '-' }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="地址">
|
||||
<span>{{ detail.supplier.address }}</span>
|
||||
<span>{{ detail.supplier.address || '-' }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="资质等级">
|
||||
<span>{{ detail.supplier.qualification }}</span>
|
||||
<span>{{ detail.supplier.qualification || '-' }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="注册资本">
|
||||
<span>{{ detail.supplier.registerCapital }}</span>
|
||||
<span>{{ detail.supplier.registerCapital || '-' }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -74,7 +78,7 @@
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="银行账户">
|
||||
<el-table :data="detail.accounts" border>
|
||||
<el-table :data="detail.accounts || []" border>
|
||||
<el-table-column label="账户ID" prop="accountId" />
|
||||
<el-table-column label="开户行" prop="bankName" />
|
||||
<el-table-column label="账号" prop="accountNo" />
|
||||
@@ -91,19 +95,19 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="合同总额">
|
||||
<span>{{ formatMoney(detail.statistics.totalContractAmount) }}</span>
|
||||
<span>{{ formatMoney(detail.statistics && detail.statistics.totalContractAmount) }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="已付款">
|
||||
<span>{{ formatMoney(detail.statistics.totalPayment) }}</span>
|
||||
<span>{{ formatMoney(detail.statistics && detail.statistics.totalPayment) }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="未付款">
|
||||
<span>{{ formatMoney(detail.statistics.unpaidAmount) }}</span>
|
||||
<span>{{ formatMoney(detail.statistics && detail.statistics.unpaidAmount) }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -111,6 +115,9 @@
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="text-center text-gray">暂无数据</div>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancel">关闭</el-button>
|
||||
</div>
|
||||
@@ -126,14 +133,22 @@ export default {
|
||||
return {
|
||||
open: false,
|
||||
title: '供应商详情',
|
||||
detail: {}
|
||||
detail: {},
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open(supplierId) {
|
||||
show(supplierId) {
|
||||
this.open = true
|
||||
this.loading = true
|
||||
this.detail = {}
|
||||
getSupplierDetail(supplierId).then(response => {
|
||||
this.detail = response.data
|
||||
this.detail = response.data || {}
|
||||
}).catch(error => {
|
||||
console.error('加载供应商详情失败:', error)
|
||||
this.detail = {}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" inline :label-width="100px">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" inline label-width="100px">
|
||||
<el-form-item label="供应商编号" prop="supplierCode">
|
||||
<el-input v-model="queryParams.supplierCode" placeholder="请输入供应商编号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
|
||||
Reference in New Issue
Block a user