Commit 12209a99 authored by hubaoshan's avatar hubaoshan

pd

parent d334e4d5
import request from '@/utils/request'
import Qs from 'qs'
/**
* 1. 列表查询
* 2. 查询详细信息
* 3. 新增
* 4. 修改
* 5. 逻辑删除
* 6. 导出
*
*/
// 1. 查询库存管理列表
export function listIncomeWmsBoxPd(query) {
return request({
url: '/incomewmsboxpd/list',
method: 'get',
params: query
})
}
export function listIncomeWmsBox(query) {
return request({
url: '/incomewmsbox/list',
method: 'get',
params: query
})
}
// 2. 查询库存管理详细信息
export function getIncomeWmsBoxPd(businessId) {
return request({
url: '/incomewmsboxpd/detail/' + businessId,
method: 'get'
})
}
// 3. 新增库存管理
export function addIncomeWmsBoxPd(data) {
data = Qs.stringify(data)
return request({
url: '/incomewmsboxpd/addQuantity',
method: 'post',
data: data,
headers: {
'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型
}
})
}
// 4. 修改库存管理
export function updateIncomeWmsBox(data) {
const businessId = data.businessId
data = Qs.stringify(data)
return request({
url: '/incomewmsboxpd/update/' + businessId,
method: 'put',
data
})
}
// 5. 删除库存管理
export function delIncomeWmsBoxPd(businessId) {
return request({
url: '/incomewmsboxpd/delete/' + businessId,
method: 'delete'
})
}
// truncate截断表
export function truncateIncomeWmsBoxPd() {
return request({
url: '/incomewmsboxpd/truncate',
method: 'delete'
})
}
// 6. 导出库存管理
export function exportIncomeWmsBoxPd(query) {
return request({
url: '/incomewmsboxpd/export',
method: 'get',
params: query,
responseType: 'blob'
})
}
export function checkIsZero(data) {
return request({
url: 'incomewmsboxpd/checkIsZero',
method: 'post',
data,
headers: {
'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型
}
})
}
...@@ -3,7 +3,8 @@ import { getRouters } from '@/api/menu' ...@@ -3,7 +3,8 @@ import { getRouters } from '@/api/menu'
import { getInfo } from '@/api/login' import { getInfo } from '@/api/login'
import Layout from '@/layout/index' import Layout from '@/layout/index'
// pathList: 是要隐藏菜单的集合 system元素:一级菜单的路径(path) // pathList: 是要隐藏菜单的集合 system元素:一级菜单的路径(path)
const pathList = ['/setup/index', '/setup/outku', '/setup/enterbound', '/setup/test', '/setup/enterboundTwo', '/setup/ApplicationTable', '/setup/inspectionRequestProcessing', '/setup/checkTheApplicationForExit'] const pathList = ['/setup/index', '/setup/outku', '/setup/enterbound', '/setup/test', '/setup/enterboundTwo', '/setup/ApplicationTable', '/setup/inspectionRequestProcessing', '/setup/checkTheApplicationForExit',
'/setup/enterboundPd']
const permission = { const permission = {
state: { state: {
routes: [], routes: [],
......
...@@ -257,7 +257,7 @@ ...@@ -257,7 +257,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="cj:" prop="cj"> <el-form-item label="cj:" prop="cj">
<span>{{getManufacturerLabel(singleDetails.cj) || '-' }}</span> <span>{{ getManufacturerLabel(singleDetails.cj) || '-' }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -345,13 +345,11 @@ ...@@ -345,13 +345,11 @@
import manufacturer from '@/data/cjlist' import manufacturer from '@/data/cjlist'
import { import {
delOutcomeWmsApply, delOutcomeWmsApply,
addOutcomeWmsApply, updateOutcomeWmsApply
updateOutcomeWmsApply,
exportOutcomeWmsApply
} from '@/api/outcomeWmsApply' } from '@/api/outcomeWmsApply'
import commonField from '@/utils/commonField' import commonField from '@/utils/commonField'
import { getDicts } from '@/api/system/dict/data' import { getDicts } from '@/api/system/dict/data'
import { exportIncomeInoutWmsLog, getIncomeInoutWmsLog, listIncomeInoutWmsLog } from '@/api/incomeInoutWmsLog' import { exportIncomeInoutWmsLog, listIncomeInoutWmsLog } from '@/api/incomeInoutWmsLog'
// import manufacturer from "@/api/outcomeWmsJbapplyTemp"; // import manufacturer from "@/api/outcomeWmsJbapplyTemp";
export default { export default {
......
...@@ -159,8 +159,8 @@ ...@@ -159,8 +159,8 @@
</el-table-column> </el-table-column>
<el-table-column label="qty" prop="qty" :show-overflow-tooltip="true" width="110"> <el-table-column label="qty" prop="qty" :show-overflow-tooltip="true" width="110">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <span v-if="scope.row.qty >= 0 ">{{scope.row.qty}}</span>--> <!-- <span v-if="scope.row.qty >= 0 ">{{scope.row.qty}}</span>-->
<!-- <span v-else>-</span>--> <!-- <span v-else>-</span>-->
{{ scope.row.qty || '-' }} {{ scope.row.qty || '-' }}
</template> </template>
</el-table-column> </el-table-column>
......
<template>
<div class="incomeWmsBoxPd-container">
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true">
<el-form-item label="ptype" prop="ptype">
<el-select
v-model="queryParams.ptype"
placeholder="请选择ptype值"
clearable
:maxlength="1"
size="small"
style="width: 150px"
>
<el-option
v-for="dict in ptypeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="cj" prop="cj">
<el-select
v-model="queryParams.cj"
class="normalSelect"
placeholder="请选择厂家"
>
<el-option
v-for="item in manufacturer"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="lot" prop="lot">
<el-input
v-model="queryParams.lot"
placeholder="请输入lot"
clearable
:maxlength="100"
size="small"
style="width: 150px"
/>
</el-form-item>
<el-form-item label="location" prop="location">
<el-input
v-model="queryParams.location"
placeholder="请输入location"
clearable
:maxlength="100"
size="small"
style="width: 150px"
/>
</el-form-item>
<el-form-item label="pn" prop="pn">
<el-input
v-model="queryParams.pn"
placeholder="请输入pn"
clearable
:maxlength="100"
size="small"
style="width: 150px"
/>
</el-form-item>
<el-form-item label="rank" prop="rank">
<el-input
v-model="queryParams.rank"
placeholder="请输入rank"
clearable
:maxlength="100"
size="small"
style="width: 150px"
/>
</el-form-item>
<el-form-item>
<el-button
:class="commonField.queryClass"
:type="commonField.typePrimary"
:icon="commonField.queryIcon"
:size="commonField.smallSize"
@click="handleQuery"
>查询
</el-button>
<el-button
:class="commonField.resetClass"
:icon="commonField.resetIcon"
:size="commonField.smallSize"
@click="resetQuery"
>重置
</el-button>
</el-form-item>
<div style="float: right">
<el-form-item>
<el-button
style="padding: 8px 7px;"
:type="commonField.typePrimary"
:size="commonField.smallSize"
:icon="addIcon"
@click="handleStart"
>开始盘点
</el-button>
<el-button
style="padding: 8px 7px;"
icon="el-icon-view"
:type="'warning'"
:size="commonField.smallSize"
@click="handleCheck"
>查看盘点
</el-button>
<el-button
style="padding: 8px 7px;"
icon="el-icon-minus"
type="danger"
:size="commonField.smallSize"
@click="handleEnd"
>结束盘点
</el-button>
</el-form-item>
</div>
</el-form>
<br>
<br>
<!-- :row-class-name="getRowClassName"-->
<div class="placeholder" />
<div style="padding:5px 10px">
<div class="mb12 font-small-bold">库存管理列表</div>
<el-table v-loading="loading" border :data="incomeWmsBoxList">
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column label="code" prop="orderCode" width="200" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.orderCode || '-' }}
</template>
</el-table-column>
<el-table-column label="cj" prop="cj" width="120" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ getManufacturerLabel(scope.row.cj) || '-' }}
</template>
</el-table-column>
<el-table-column label="ptype" prop="ptype" width="150" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.ptype === '1'">jb</span>
<span v-else-if="scope.row.ptype === '2'">label</span>
<span v-else-if="scope.row.ptype === '3'">wd</span>
<span v-else-if="scope.row.ptype === '4'">sl</span>
<span v-else-if="scope.row.ptype === '5'">zd</span>
<span v-else-if="scope.row.ptype === '20'">jl</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="lot" prop="lot" width="150" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.lot || '-' }}
</template>
</el-table-column>
<el-table-column v-if="false" label="flag" prop="flag" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.flag }}</span>
</template>
</el-table-column>
<el-table-column label="location" prop="location" width="150" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.location || '-' }}
</template>
</el-table-column>
<el-table-column label="pn" prop="pn" width="150" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.pn || '-' }}
</template>
</el-table-column>
<el-table-column label="rank" prop="rank" width="150" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.rank || '-' }}
</template>
</el-table-column>
<el-table-column label="qty" prop="qty" width="150" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.qty || '-' }}
</template>
</el-table-column>
<el-table-column label="label_id" prop="labelId" width="150" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.mac || '-' }}
</template>
</el-table-column>
</el-table>
</div>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.rows"
@pagination="getList"
/>
<el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
<el-table
v-loading="loading"
border
:data="tableList"
:row-class-name="getRowClassName"
>
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column label="code" prop="orderCode" width="200" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.orderCode || '-' }}
</template>
</el-table-column>
<el-table-column label="cj" prop="cj" width="120" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ getManufacturerLabel(scope.row.cj) || '-' }}
</template>
</el-table-column>
<el-table-column label="ptype" prop="ptype" width="120" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.ptype === '1'">jb</span>
<span v-else-if="scope.row.ptype === '2'">label</span>
<span v-else-if="scope.row.ptype === '3'">wd</span>
<span v-else-if="scope.row.ptype === '4'">sl</span>
<span v-else-if="scope.row.ptype === '5'">zd</span>
<span v-else-if="scope.row.ptype === '20'">jl</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="lot" prop="lot" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
{{ scope.row.lot || '-' }}
</template>
</el-table-column>
<el-table-column v-if="false" label="flag" prop="flag" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.flag }}</span>
</template>
</el-table-column>
<el-table-column label="location" prop="location" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
{{ scope.row.location || '-' }}
</template>
</el-table-column>
<el-table-column label="pn" prop="pn" :show-overflow-tooltip="true" width="150">
<template slot-scope="scope">
{{ scope.row.pn || '-' }}
</template>
</el-table-column>
<el-table-column label="rank" prop="rank" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
{{ scope.row.rank || '-' }}
</template>
</el-table-column>
<el-table-column label="qty" prop="qty" :show-overflow-tooltip="true" width="150">
<template slot-scope="scope">
{{ scope.row.qty || '-' }}
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:title="title"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.rows"
@pagination="getList1"
/>
</el-dialog>
</div>
</template>
<script>
import {
listIncomeWmsBox,
getIncomeWmsBox,
delIncomeWmsBox,
addIncomeWmsBox,
updateIncomeWmsBox,
exportIncomeWmsBox
} from '@/api/incomeWmsBox'
import commonField from '@/utils/commonField'
import manufacturer from '@/data/cjlist'
import { addIncomeWmsBoxPd, listIncomeWmsBoxPd, truncateIncomeWmsBoxPd } from '@/api/incomeWmsBoxPd'
export default {
name: 'IncomeWmsBoxPd',
data() {
return {
// 遮罩层
loading: true,
// 总条数
total: 0,
manufacturer: {},
// 库存管理表格数据
incomeWmsBoxList: [],
// 弹出层标题
title: '',
// 是否显示弹出层
open: false,
// 状态菜单
statusOptions: [
{
dictLabel: '启用',
dictValue: '1'
},
{
dictLabel: '停用',
dictValue: '0'
}
],
// ptype菜单
ptypeOptions: [
{
dictLabel: 'jb',
dictValue: '1'
},
{
dictLabel: 'label',
dictValue: '2'
},
{
dictLabel: 'wd',
dictValue: '3'
},
{
dictLabel: 'sl',
dictValue: '4'
},
{
dictLabel: 'zd',
dictValue: '5'
},
{
dictLabel: 'jl',
dictValue: '20'
}
],
addIcon: 'el-icon-plus',
tableList: [],
// 查询参数
queryParams: {
page: 1,
rows: 10,
lot: undefined,
pn: undefined,
qty: undefined,
rank: undefined,
orderCode: undefined,
labelId: undefined,
location: undefined,
ptype: '1',
flag: ''
},
// 表单参数
form: {},
// 表单校验
rules: {}
}
},
computed: {
commonField() {
return commonField
}
},
/** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) {
this.$store.dispatch('searchSave/searchParamsSet', {
path: this.$route.path,
param: {
...this.queryParams
}
})
next()
},
created() {
this.manufacturer = manufacturer
if (this.$store.getters.searchParams[this.$route.path]) {
const { searchParams } = this.$store.getters
const { path } = this.$route
const param = JSON.parse(searchParams[path]) // 保留着的查询条件
this.queryParams = { ...param }
}
this.getList() // 列表查询
},
methods: {
getRowClassName({ row }) {
return Number(row.flag) === 0 ? 'redBg' : ''
},
getManufacturerLabel(cj) {
const manufacturer = this.manufacturer.find(item => item.value === cj)
return manufacturer ? manufacturer.label : null
},
/** 查询库存管理列表 */
getList() {
this.loading = true
listIncomeWmsBox(this.queryParams).then(
response => {
this.incomeWmsBoxList = response.rows
this.total = response.total
this.loading = false
}
)
},
getList1() {
listIncomeWmsBoxPd(this.queryParams).then(
response => {
this.tableList = response.rows
this.total = response.total
}
)
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
this.form = {
businessId: undefined,
remarks: undefined,
lot: undefined,
pn: undefined,
qty: undefined,
rank: undefined,
orderCode: undefined,
labelId: undefined,
location: undefined,
flag: ''
}
this.resetForm('form')
},
/** 查询按钮操作 */
handleQuery() {
this.queryParams.page = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
page: 1,
rows: 10,
lot: undefined,
pn: undefined,
qty: undefined,
rank: undefined,
orderCode: undefined,
labelId: undefined,
flag: '',
ptype: '1'
}
this.handleQuery()
},
/** 开始盘点按钮操作 */
handleStart() {
this.loading = false
this.$confirm('确认要开始盘点吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
addIncomeWmsBoxPd(this.queryParams).then(response => {
this.$message({ message: '开始盘点...', type: 'success' })
})
}).catch(() => {
this.message({ message: '取消开始盘点', type: 'info' })
})
},
/** 查看盘点按钮操作 */
handleCheck() {
this.open = true
this.title = '查看盘点'
this.getList1()
},
/** 结束盘点按钮操作 */
handleEnd() {
this.$confirm('确认要结束盘点吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(response => {
truncateIncomeWmsBoxPd().then(response => {
this.$message({ message: '盘点结束', type: 'success' })
}).catch(error => {
console.error('Error:', error)
})
})
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.businessId
getIncomeWmsBox(id).then(response => {
this.form = response.data
this.open = true
this.title = '修改库存管理'
})
},
// 改变状态
handleStatusChange(row) {
const text = row.flag === '1' ? '启用' : '停用'
this.$confirm('确认操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return updateIncomeWmsBox(row)
}).then(() => {
this.$message({
message: text + '成功',
type: 'success'
})
}).catch(function() {
row.flag = row.flag === '0' ? '1' : '0'
})
},
/** 提交按钮 */
submitForm: function() {
this.$refs['form'].validate(valid => {
if (valid) {
if (this.form.businessId !== undefined) {
updateIncomeWmsBox(this.form).then(response => {
this.msgSuccess('修改成功')
this.open = false
this.getList1()
})
} else {
addIncomeWmsBox(this.form).then(response => {
this.msgSuccess('新增成功')
this.open = false
this.getList1()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.businessId
this.$confirm('是否确认操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return delIncomeWmsBox(id)
}).then(() => {
this.getList1()
this.$message({
message: '删除成功',
type: 'success'
})
}).catch(function() {
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams
this.$confirm('是否确认操作?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return exportIncomeWmsBox(queryParams).then(response => {
const blob = new Blob([response])
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)// 创建下载的链接
downloadElement.href = href
downloadElement.download = '库存管理信息' + '.xls' // 下载后文件名
document.body.appendChild(downloadElement)
downloadElement.click()// 点击下载
document.body.removeChild(downloadElement)// 下载完成移除元素
window.URL.revokeObjectURL(href)// 释放掉blob对象
})
})
}
}
}
</script>
<style lang="scss">
.incomeWmsBoxPd-container {
font-size: 18px;
padding: 0;
.placeholder {
height: 1.3vh;
background-color: #F4F4F4;
margin-bottom: 10px
}
}
.redBg {
background-color: #f4ac10 !important;;
}
</style>
...@@ -183,7 +183,7 @@ ...@@ -183,7 +183,7 @@
<span v-else>-</span> <span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" min-width="160px"> <el-table-column label="操作" class-name="small-padding fixed-width" min-width="160px" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
v-show="scope.row.dealStatus !=='1'" v-show="scope.row.dealStatus !=='1'"
...@@ -259,10 +259,10 @@ ...@@ -259,10 +259,10 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="cj" prop="cj" :rules="[{required: form.ptype === '1', message: '请输入rank的值', trigger: 'blur' }]"> <el-form-item label="cj" prop="cj" :rules="[{required: form.ptype === '1', message: '请输入rank的值', trigger: 'blur' }]">
<el-select <el-select
:disabled="isDisabled"
v-model="form.cj" v-model="form.cj"
:disabled="isDisabled"
style="width: 100%" style="width: 100%"
class="normalSelect" class="normalSelect"
placeholder="请选择厂家" placeholder="请选择厂家"
...@@ -499,7 +499,7 @@ import { ...@@ -499,7 +499,7 @@ import {
import commonField from '@/utils/commonField' import commonField from '@/utils/commonField'
import { getDicts } from '@/api/system/dict/data' import { getDicts } from '@/api/system/dict/data'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import manufacturer from "@/data/cjlist"; import manufacturer from '@/data/cjlist'
export default { export default {
name: 'OutcomeWmsJbapplyTemp', name: 'OutcomeWmsJbapplyTemp',
data() { data() {
...@@ -744,6 +744,14 @@ export default { ...@@ -744,6 +744,14 @@ export default {
beforeRemove(file, fileList) { beforeRemove(file, fileList) {
this.files = [] this.files = []
}, },
// :on-progress="handleFileUploadProgress"
// :on-success="handleFileSuccess"
// :auto-upload="false"
// :on-change="employeeUpload"
// :on-remove="handleRemove"
// :before-remove="beforeRemove"
// :on-preview="handlePreview"
/* 上传文件所需求 */ /* 上传文件所需求 */
handlePreview(file) { handlePreview(file) {
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment