Commit 902789ab authored by Hagsn3's avatar Hagsn3

代码提交

parent 7cf95c72
import request from '@/utils/request'
import Qs from 'qs'
/**
* 1. 列表查询
* 2. 查询详细信息
* 3. 新增
* 4. 修改
* 5. 逻辑删除
* 6. 导出
*
*/
// 1. 查询入库记录列表
export function listIncomeInoutWmsLog(query) {
return request({
url: '/incomeinoutwmslog/list',
method: 'get',
params: query
})
}
// 2. 查询入库记录详细信息
export function getIncomeInoutWmsLog(businessId) {
return request({
url: '/incomeinoutwmslog/detail/' + businessId,
method: 'get'
})
}
// 3. 新增入库记录
export function addIncomeInoutWmsLog(data) {
data = Qs.stringify(data)
return request({
url: '/incomeinoutwmslog/add',
method: 'post',
data: data
})
}
// 4. 修改入库记录
export function updateIncomeInoutWmsLog(data) {
const businessId = data.businessId
data = Qs.stringify(data)
return request({
url: '/incomeinoutwmslog/update/' + businessId,
method: 'put',
data
})
}
// 5. 逻辑删除入库记录
export function delIncomeInoutWmsLog(businessId) {
return request({
url: '/incomeinoutwmslog/deleteLogical/' + businessId,
method: 'delete'
})
}
// 6. 导出入库记录
export function exportIncomeInoutWmsLog(query) {
return request({
url: '/incomeinoutwmslog/export',
method: 'get',
params: query,
responseType: 'blob'
})
}
import request from '@/utils/request'
import Qs from 'qs'
/**
* 1. 列表查询
* 2. 查询详细信息
* 3. 新增
* 4. 修改
* 5. 逻辑删除
* 6. 导出
*
*/
// 1. 查询????列表
export function listIncomeMatBaseinfo(query) {
return request({
url: '/incomematbaseinfo/list',
method: 'get',
params: query
})
}
// 2. 查询????详细信息
export function getIncomeMatBaseinfo(businessId) {
return request({
url: '/incomematbaseinfo/detail/' + businessId,
method: 'get'
})
}
// 3. 新增????
export function addIncomeMatBaseinfo(data) {
data = Qs.stringify(data)
return request({
url: '/incomematbaseinfo/add',
method: 'post',
data: data
})
}
// 4. 修改????
export function updateIncomeMatBaseinfo(data) {
const businessId = data.businessId
data = Qs.stringify(data)
return request({
url: '/incomematbaseinfo/update/' + businessId,
method: 'put',
data
})
}
// 5. 逻辑删除????
export function delIncomeMatBaseinfo(businessId) {
return request({
url: '/incomematbaseinfo/deleteLogical/' + businessId,
method: 'delete'
})
}
// 6. 导出????
export function exportIncomeMatBaseinfo(query) {
return request({
url: '/incomematbaseinfo/export',
method: 'get',
params: query,
responseType: 'blob'
})
}
import request from '@/utils/request'
import Qs from 'qs'
/**
* 1. 列表查询
* 2. 查询详细信息
* 3. 新增
* 4. 修改
* 5. 逻辑删除
* 6. 导出
*
*/
// 1. 查询????列表
export function listOutcomeWmsApply(query) {
return request({
url: '/outcomewmsapply/list',
method: 'get',
params: query
})
}
// 2. 查询????详细信息
export function getOutcomeWmsApply(businessId) {
return request({
url: '/outcomewmsapply/detail/' + businessId,
method: 'get'
})
}
// 3. 新增????
export function addOutcomeWmsApply(data) {
data = Qs.stringify(data)
return request({
url: '/outcomewmsapply/add',
method: 'post',
data: data
})
}
// 4. 修改????
export function updateOutcomeWmsApply(data) {
const businessId = data.businessId
data = Qs.stringify(data)
return request({
url: '/outcomewmsapply/update/' + businessId,
method: 'put',
data
})
}
// 5. 逻辑删除????
export function delOutcomeWmsApply(businessId) {
return request({
url: '/outcomewmsapply/deleteLogical/' + businessId,
method: 'delete'
})
}
// 6. 导出????
export function exportOutcomeWmsApply(query) {
return request({
url: '/outcomewmsapply/export',
method: 'get',
params: query,
responseType: 'blob'
})
}
<template>
<div class="app-container">
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true">
<el-form-item label="pn" prop="pn">
<el-input
v-model="queryParams.pn"
placeholder="请输入pn"
clearable
size="small"
style="width: 150px"
/>
</el-form-item>
<el-form-item label="qty" prop="qty">
<el-input
v-model.trim="form.qty"
placeholder="请输入qty"
clearable
size="small"
style="width: 150px"
/>
</el-form-item>
<el-form-item label="code" prop="orderCode">
<el-input
v-model="queryParams.orderCode"
placeholder="请输入code"
clearable
:maxlength="100"
size="small"
style="width: 150px"
/>
</el-form-item>
<el-form-item label="io_type" prop="ioType">
<el-input
v-model="queryParams.ioType"
placeholder="请输入code"
clearable
:maxlength="100"
size="small"
style="width: 150px"
/>
</el-form-item>
<el-form-item label="仓库" prop="whId">
<el-select
v-model="queryParams.whId"
placeholder="请选择仓库"
clearable
size="small"
style="width: 150px"
>
<el-option
v-for="dict in warehouseList"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</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
:class="commonField.addClass"
:type="commonField.typePrimary"
:icon="commonField.addIcon"
:size="commonField.smallSize"
@click="handleAdd"
>新增</el-button>
<el-button
:class="commonField.exportClass"
:type="commonField.typeSuccess"
:icon="commonField.exportIcon"
:size="commonField.smallSize"
@click="handleExport"
>导出</el-button>
</el-form-item>
</div>
</el-form>
<div class="placeholder" />
<div style="padding:5px 10px">
<div class="mb12 font-small-bold">领用申请列表</div>
<el-table v-loading="loading" border :data="outcomeWmsApplyList">
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column label="pn" prop="pn" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.pn || '-' }}
</template>
</el-table-column>
<el-table-column label="qty" prop="qty" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.qty || '-' }}
</template>
</el-table-column>
<el-table-column label="wh_id" prop="whId" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.whId || '-' }}
</template>
</el-table-column>
<el-table-column label="ptype" prop="ptype" :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>-</span>
</template>
</el-table-column>
<el-table-column label="出库状态" prop="dealStatus" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.dealStatus === '1'">已出库</span>
<span v-else-if="scope.row.dealStatus === '0'">未出库</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="确认状态" prop="sureStatus" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.sureStatus === '1'">已确认</span>
<span v-else-if="scope.row.sureStatus === '0'">待确认</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column width="120" label="启用状态" prop="flag">
<template slot-scope="scope">
<el-switch
v-model="scope.row.flag"
class="switchDisabledStyle"
inactive-value="0"
active-value="1"
@click.native="handleStatusChange(scope.row)"
/>
</template>
</el-table-column>
<el-table-column label="备注" prop="remarks" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.remarks || '-' }}
</template>
</el-table-column>
<el-table-column label="创建时间" prop="createDate" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="200px">
<template slot-scope="scope">
<!-- <el-button-->
<!-- :class="commonField.updateClass"-->
<!-- :type="commonField.typeParent"-->
<!-- :size="commonField.size"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- >修改</el-button>-->
<el-button
:class="commonField.delClass"
:type="commonField.typeParent"
:size="commonField.size"
@click="handleDelete(scope.row)"
>删除</el-button>
</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="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="90px">
<el-form-item label="wh_id" prop="whId">
<el-select
v-model="form.whId"
placeholder="请选择仓库"
clearable
size="small"
style="width: 100%"
>
<el-option
v-for="dict in warehouseList"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="ptype" prop="ptype">
<el-select
v-model="form.ptype"
placeholder="请选择ptype值"
clearable
:maxlength="1"
size="small"
style="width: 100%"
>
<el-option
v-for="dict in addTypeOption"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="pn" prop="pn">
<el-input v-model.trim="form.pn" show-word-limit :maxlength="100" placeholder="请输入pn" />
</el-form-item>
<el-form-item label="qty" prop="qty">
<el-input v-model.trim="form.qty" placeholder="请输入qty的值" />
</el-form-item>
<el-form-item label="出库状态">
<el-radio-group v-model="form.dealStatus" show-word-limit :maxlength="1">
<el-radio label="1">已出库</el-radio>
<el-radio label="0">未出库</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="确认状态">
<el-radio-group v-model="form.sureStatus" show-word-limit :maxlength="1">
<el-radio label="1">已确认</el-radio>
<el-radio label="0">待确认</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="状态">
<el-radio-group v-model="form.flag">
<el-radio label="1">启用</el-radio>
<el-radio label="0">停用</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button class="cancelBtn" @click="cancel">取 消</el-button>
<el-button class="submitBtn" type="primary" @click="submitForm">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listOutcomeWmsApply,
getOutcomeWmsApply,
delOutcomeWmsApply,
addOutcomeWmsApply,
updateOutcomeWmsApply,
exportOutcomeWmsApply } from '@/api/outcomeWmsApply'
import commonField from '@/utils/commonField'
import { getDicts } from '@/api/system/dict/data'
export default {
name: 'EnterboundTwo',
data() {
return {
// 遮罩层
loading: true,
// 总条数
total: 0,
// ????表格数据
outcomeWmsApplyList: [],
warehouseList: [],
// 弹出层标题
title: '',
// 是否显示弹出层
open: false,
// 状态菜单
statusOptions: [
{
dictLabel: '启用',
dictValue: '1'
},
{
dictLabel: '停用',
dictValue: '0'
}
],
dealStatusOption: [
{
dictLabel: '已出库',
dictValue: '1'
},
{
dictLabel: '未出库',
dictValue: '0'
}
],
sureStatusOption: [
{
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'
}
],
addTypeOption: [
{
dictLabel: 'label',
dictValue: '2'
},
{
dictLabel: 'wd',
dictValue: '3'
},
{
dictLabel: 'sl',
dictValue: '4'
},
{
dictLabel: 'zd',
dictValue: '5'
}
],
// 查询参数
queryParams: {
page: 1,
rows: 10,
pn: undefined,
qty: undefined,
orderCode: undefined,
ioType: undefined,
whId: undefined,
flag: ''
},
// 表单参数
form: {
whId: '001',
pn: null,
qty: null,
dealStatus: '0',
sureStatus: '0',
ptype: '2'
},
// 表单校验
rules: {
}
}
},
computed: {
commonField() {
return commonField
}
},
created() {
this.getList() // 列表查询
this.getwareHouse()
},
methods: {
/** 查询????列表 */
getList() {
this.loading = true
listOutcomeWmsApply(this.queryParams).then(
response => {
this.outcomeWmsApplyList = response.rows
this.total = response.total
this.loading = false
}
)
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
this.form = {
businessId: undefined,
remarks: undefined,
pn: undefined,
qty: undefined,
whId: '001',
ptype: '2',
dealStatus: '0',
sureStatus: '0',
flag: '1'
}
this.resetForm('form')
},
/** 查询按钮操作 */
handleQuery() {
this.queryParams.page = 1
this.getList()
},
getwareHouse() {
getDicts('WAREHOUSE').then(res => {
console.log('仓库数据字典', res)
this.warehouseList = res.data
const whId = res.data[0].dictValue
this.form.whId = whId
})
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
page: 1,
rows: 10,
pn: undefined,
qty: undefined,
whId: undefined,
ptype: undefined,
dealStatus: undefined,
sureStatus: undefined,
flag: ''
}
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = '添加领用申请'
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.businessId
getOutcomeWmsApply(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 updateOutcomeWmsApply(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) {
updateOutcomeWmsApply(this.form).then(response => {
this.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
console.log(this.form)
addOutcomeWmsApply(this.form).then(response => {
this.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.businessId
this.$confirm('是否确认操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return delOutcomeWmsApply(id)
}).then(() => {
this.getList()
this.$message({
message: '删除成功',
type: 'success'
})
}).catch(function() {
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams
this.$confirm('是否确认操作?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return exportOutcomeWmsApply(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" scoped>
.app-container {
font-size: 18px;
padding: 0;
.placeholder {
height: 1.3vh;
background-color: #F4F4F4;
margin-bottom: 10px
}
}
</style>
<template>
<div class="app-container">
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true">
<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="wh_id" prop="whId">
<el-select
v-model="queryParams.whId"
placeholder="请选择仓库"
clearable
size="small"
style="width: 150px"
>
<el-option
v-for="dict in warehouseList"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<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="出库状态" prop="dealStatus">
<el-select v-model="queryParams.dealStatus" placeholder="请选择出库状态" clearable size="small" :maxlength="1">
<el-option
v-for="dict in dealStatusOption"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="确认状态" prop="sureStatus">
<el-select v-model="queryParams.sureStatus" placeholder="请选择确认状态" clearable size="small" :maxlength="1">
<el-option
v-for="dict in sureStatusOption"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="状态" prop="flag">
<el-select v-model="queryParams.flag" placeholder="请选择状态" clearable size="small">
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</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
:class="commonField.exportClass"
:type="commonField.typeSuccess"
:icon="commonField.exportIcon"
:size="commonField.smallSize"
@click="handleExport"
>导出</el-button>
</el-form-item>
</div>
</el-form>
<div class="placeholder" />
<div style="padding:5px 10px">
<div class="mb12 font-small-bold">材料确认列表</div>
<el-table v-loading="loading" border :data="outcomeWmsApplyList">
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column label="pn" prop="pn" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.pn || '-' }}
</template>
</el-table-column>
<el-table-column label="qty" prop="qty" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.qty || '-' }}
</template>
</el-table-column>
<el-table-column label="wh_id" prop="whId" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.whId || '-' }}
</template>
</el-table-column>
<el-table-column label="ptype" prop="ptype" :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>-</span>
</template>
</el-table-column>
<el-table-column label="出库状态" prop="dealStatus" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.dealStatus === '1'">已出库</span>
<span v-else-if="scope.row.dealStatus === '0'">未出库</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="确认状态" prop="sureStatus" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.sureStatus === '1'">已确认</span>
<span v-else-if="scope.row.sureStatus === '0'">待确认</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column width="120" label="启用状态" prop="flag">
<template slot-scope="scope">
<el-switch
v-model="scope.row.flag"
class="switchDisabledStyle"
inactive-value="0"
active-value="1"
@click.native="handleStatusChange(scope.row)"
/>
</template>
</el-table-column>
<el-table-column label="备注" prop="remarks" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.remarks || '-' }}
</template>
</el-table-column>
<el-table-column label="创建时间" prop="createDate" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="200px">
<template slot-scope="scope">
<el-button
:class="commonField.updateClass"
:type="commonField.typeParent"
:size="commonField.size"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
:class="commonField.delClass"
:type="commonField.typeParent"
:size="commonField.size"
@click="handleDelete(scope.row)"
>删除</el-button>
</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="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="90px">
<el-form-item label="wh_id" prop="whId">
<el-select
v-model="form.whId"
placeholder="请选择仓库"
clearable
size="small"
style="width: 100%"
>
<el-option
v-for="dict in warehouseList"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="ptype" prop="ptype">
<el-select
v-model="form.ptype"
placeholder="请选择ptype值"
clearable
:maxlength="1"
size="small"
style="width: 100%"
>
<el-option
v-for="dict in addTypeOption"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="pn" prop="pn">
<el-input v-model.trim="form.pn" show-word-limit :maxlength="100" placeholder="请输入pn" />
</el-form-item>
<el-form-item label="qty" prop="qty">
<el-input v-model.trim="form.qty" placeholder="请输入qty的值" />
</el-form-item>
<el-form-item label="出库状态">
<el-radio-group v-model="form.dealStatus" show-word-limit :maxlength="1">
<el-radio label="1">已出库</el-radio>
<el-radio label="0">未出库</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="确认状态">
<el-radio-group v-model="form.sureStatus" show-word-limit :maxlength="1">
<el-radio label="1">已确认</el-radio>
<el-radio label="0">待确认</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="状态">
<el-radio-group v-model="form.flag">
<el-radio label="1">启用</el-radio>
<el-radio label="0">停用</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button class="cancelBtn" @click="cancel">取 消</el-button>
<el-button class="submitBtn" type="primary" @click="submitForm">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listOutcomeWmsApply,
getOutcomeWmsApply,
delOutcomeWmsApply,
updateOutcomeWmsApply,
exportOutcomeWmsApply } from '@/api/outcomeWmsApply'
import commonField from '@/utils/commonField'
import { getDicts } from '@/api/system/dict/data'
export default {
name: 'ConfirmationMaterials',
data() {
return {
// 遮罩层
loading: true,
// 总条数
total: 0,
// ????表格数据
outcomeWmsApplyList: [],
warehouseList: [],
// 弹出层标题
title: '',
// 是否显示弹出层
open: false,
// 状态菜单
statusOptions: [
{
dictLabel: '启用',
dictValue: '1'
},
{
dictLabel: '停用',
dictValue: '0'
}
],
dealStatusOption: [
{
dictLabel: '已出库',
dictValue: '1'
},
{
dictLabel: '未出库',
dictValue: '0'
}
],
sureStatusOption: [
{
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'
}
],
addTypeOption: [
{
dictLabel: 'label',
dictValue: '2'
},
{
dictLabel: 'wd',
dictValue: '3'
},
{
dictLabel: 'sl',
dictValue: '4'
},
{
dictLabel: 'zd',
dictValue: '5'
}
],
// 查询参数
queryParams: {
page: 1,
rows: 10,
pn: undefined,
qty: undefined,
whId: undefined,
ptype: undefined,
dealStatus: undefined,
sureStatus: undefined,
flag: ''
},
// 表单参数
form: {
whId: '001',
pn: null,
qty: null,
dealStatus: '0',
sureStatus: '0',
ptype: '2'
},
// 表单校验
rules: {
}
}
},
computed: {
commonField() {
return commonField
}
},
created() {
this.getList() // 列表查询
this.getwareHouse()
},
methods: {
/** 查询????列表 */
getList() {
this.loading = true
listOutcomeWmsApply(this.queryParams).then(
response => {
this.outcomeWmsApplyList = response.rows
this.total = response.total
this.loading = false
}
)
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
this.form = {
businessId: undefined,
remarks: undefined,
pn: undefined,
qty: undefined,
whId: '001',
ptype: '2',
dealStatus: '0',
sureStatus: '0',
flag: '1'
}
this.resetForm('form')
},
/** 查询按钮操作 */
handleQuery() {
this.queryParams.page = 1
this.getList()
},
getwareHouse() {
getDicts('WAREHOUSE').then(res => {
console.log('仓库数据字典', res)
this.warehouseList = res.data
const whId = res.data[0].dictValue
this.form.whId = whId
})
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
page: 1,
rows: 10,
pn: undefined,
qty: undefined,
whId: undefined,
ptype: undefined,
dealStatus: undefined,
sureStatus: undefined,
flag: ''
}
this.handleQuery()
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.businessId
getOutcomeWmsApply(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 updateOutcomeWmsApply(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) {
updateOutcomeWmsApply(this.form).then(response => {
this.msgSuccess('修改成功')
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.businessId
this.$confirm('是否确认操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return delOutcomeWmsApply(id)
}).then(() => {
this.getList()
this.$message({
message: '删除成功',
type: 'success'
})
}).catch(function() {
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams
this.$confirm('是否确认操作?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return exportOutcomeWmsApply(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" scoped>
.app-container {
font-size: 18px;
padding: 0;
.placeholder {
height: 1.3vh;
background-color: #F4F4F4;
margin-bottom: 10px
}
}
</style>
<template>
<div class="app-container">
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true">
<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="memo1" prop="memo1">
<el-input
v-model="queryParams.memo1"
placeholder="请输入memo1"
clearable
:maxlength="127"
size="small"
style="width: 150px"
/>
</el-form-item>
<el-form-item label="meno2" prop="memo2">
<el-input
v-model="queryParams.memo2"
placeholder="请输入meno2"
clearable
:maxlength="127"
size="small"
style="width: 150px"
/>
</el-form-item>
<el-form-item label="memo3" prop="memo3">
<el-input
v-model="queryParams.memo3"
placeholder="请输入memo3"
clearable
:maxlength="127"
size="small"
style="width: 150px"
/>
</el-form-item>
<!-- 1 jb 2 label 3 wd 4 sl 5 zd-->
<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="状态" prop="flag">
<el-select v-model="queryParams.flag" placeholder="请选择状态" clearable size="small">
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</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
:class="commonField.addClass"
:type="commonField.typePrimary"
:icon="commonField.addIcon"
:size="commonField.smallSize"
@click="handleAdd"
>新增</el-button>
<el-button
:class="commonField.exportClass"
:type="commonField.typeSuccess"
:icon="commonField.exportIcon"
:size="commonField.smallSize"
@click="handleExport"
>导出</el-button>
</el-form-item>
</div>
</el-form>
<div class="placeholder" />
<div style="padding:5px 10px">
<div class="mb12 font-small-bold">库存管理列表</div>
<el-table v-loading="loading" border :data="incomeMatBaseinfoList">
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column label="pn" prop="pn" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.pn || '-' }}
</template>
</el-table-column>
<el-table-column label="qty_default" prop="qty" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.qty || '-' }}
</template>
</el-table-column>
<el-table-column label="memo1" prop="memo1" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.memo1 || '-' }}
</template>
</el-table-column>
<el-table-column label="meno2" prop="memo2" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.memo2 || '-' }}
</template>
</el-table-column>
<el-table-column label="memo3" prop="memo3" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.memo3 || '-' }}
</template>
</el-table-column>
<!-- 1 jb 2 label 3 wd 4 sl 5 zd-->
<el-table-column label="ptype" prop="ptype" :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>-</span>
</template>
</el-table-column>
<el-table-column width="120" label="状态" prop="flag">
<template slot-scope="scope">
<el-switch
v-model="scope.row.flag"
class="switchDisabledStyle"
inactive-value="0"
active-value="1"
@click.native="handleStatusChange(scope.row)"
/>
</template>
</el-table-column>
<el-table-column label="备注" prop="remarks" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.remarks || '-' }}
</template>
</el-table-column>
<el-table-column label="创建时间" prop="createDate" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="200px">
<template slot-scope="scope">
<el-button
:class="commonField.updateClass"
:type="commonField.typeParent"
:size="commonField.size"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
:class="commonField.delClass"
:type="commonField.typeParent"
:size="commonField.size"
@click="handleDelete(scope.row)"
>删除</el-button>
</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="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="90px">
<el-form-item label="ptype" prop="ptype">
<el-select
v-model="form.ptype"
placeholder="请选择ptype值"
clearable
:maxlength="1"
size="small"
style="width: 100%"
>
<el-option
v-for="dict in addTypeOption"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="pn" prop="pn">
<el-input v-model.trim="form.pn" show-word-limit :maxlength="100" placeholder="请输入pn" />
</el-form-item>
<el-form-item label="qty" prop="qty">
<!-- <el-input-number v-model.trim="form.qty" controls-position="right" :min="0" style="width: 100%" />-->
<el-input v-model.trim="form.qty" placeholder="请输入qty的值" />
</el-form-item>
<el-form-item label="memo1" prop="memo1">
<el-input v-model.trim="form.memo1" show-word-limit :maxlength="127" placeholder="请输入memo1" />
</el-form-item>
<el-form-item label="meno2" prop="memo2">
<el-input v-model.trim="form.memo2" show-word-limit :maxlength="127" placeholder="请输入meno2" />
</el-form-item>
<el-form-item label="memo3" prop="memo3">
<el-input v-model.trim="form.memo3" show-word-limit :maxlength="127" placeholder="请输入memo3" />
</el-form-item>
<el-form-item label="状态">
<el-radio-group v-model="form.flag">
<el-radio label="1">启用</el-radio>
<el-radio label="0">停用</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input v-model.trim="form.remarks" maxlength="200" show-word-limit type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button class="cancelBtn" @click="cancel">取 消</el-button>
<el-button class="submitBtn" type="primary" @click="submitForm">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listIncomeMatBaseinfo,
getIncomeMatBaseinfo,
delIncomeMatBaseinfo,
addIncomeMatBaseinfo,
updateIncomeMatBaseinfo,
exportIncomeMatBaseinfo } from '@/api/incomeMatBaseinfo'
import commonField from '@/utils/commonField'
export default {
name: 'IncomeMatBaseinfo',
data() {
return {
// 遮罩层
loading: true,
// 总条数
total: 0,
// ????表格数据
incomeMatBaseinfoList: [],
// 弹出层标题
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'
}
],
addTypeOption: [
{
dictLabel: 'label',
dictValue: '2'
},
{
dictLabel: 'wd',
dictValue: '3'
},
{
dictLabel: 'sl',
dictValue: '4'
},
{
dictLabel: 'zd',
dictValue: '5'
}
],
// 查询参数
queryParams: {
page: 1,
rows: 10,
pn: undefined,
qty: undefined,
memo1: undefined,
memo2: undefined,
memo3: undefined,
ptype: undefined,
flag: ''
},
// 表单参数
form: {
pn: null,
qty: null,
memo1: null,
memo2: null,
memo3: null,
ptype: '2',
flag: ''
},
// 表单校验
rules: {
ptype: [
{ required: true, message: '请选择ptype的值', trigger: 'blur' }
],
pn: [
{ required: true, message: '请输入pn的值', trigger: 'blur' }
],
qty: [
{ required: true, message: '请输入qty的值', trigger: 'blur' },
{ pattern: /^(0|[1-9]\d*)$/, message: '输入值不符合格式要求,请重新输入', trigger: 'blur' }
]
}
}
},
computed: {
commonField() {
return commonField
}
},
created() {
this.getList() // 列表查询
},
methods: {
/** 查询????列表 */
getList() {
this.loading = true
listIncomeMatBaseinfo(this.queryParams).then(
response => {
this.incomeMatBaseinfoList = response.rows
this.total = response.total
this.loading = false
}
)
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
this.form = {
businessId: undefined,
remarks: undefined,
pn: undefined,
qty: undefined,
memo1: undefined,
memo2: undefined,
memo3: undefined,
ptype: '2',
flag: '1'
}
this.resetForm('form')
},
/** 查询按钮操作 */
handleQuery() {
this.queryParams.page = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
page: 1,
rows: 10,
pn: undefined,
qty: undefined,
memo1: undefined,
memo2: undefined,
memo3: undefined,
ptype: undefined,
flag: ''
}
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = '添加材料信息'
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.businessId
getIncomeMatBaseinfo(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 updateIncomeMatBaseinfo(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) {
updateIncomeMatBaseinfo(this.form).then(response => {
this.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addIncomeMatBaseinfo(this.form).then(response => {
this.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.businessId
this.$confirm('是否确认操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return delIncomeMatBaseinfo(id)
}).then(() => {
this.getList()
this.$message({
message: '删除成功',
type: 'success'
})
}).catch(function() {
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams
this.$confirm('是否确认操作?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return exportIncomeMatBaseinfo(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" scoped>
.app-container {
font-size: 18px;
padding: 0;
.placeholder {
height: 1.3vh;
background-color: #F4F4F4;
margin-bottom: 10px
}
}
</style>
......@@ -148,7 +148,8 @@
<el-input v-model.trim="form.mac" show-word-limit :maxlength="100" placeholder="请输入mac" />
</el-form-item>
<el-form-item label="pn: " prop="pn">
<span>{{ form.pn }}</span>
<el-input v-model.trim="form.pn" placeholder="请输入pn值" />
<!-- <span>{{ form.pn }}</span>-->
</el-form-item>
<el-form-item label="location: " prop="location">
<el-input v-model.trim="form.location" show-word-limit :maxlength="100" placeholder="请输入location" @input="handleBarcode" />
......
<template>
<div class="app-container">
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true">
<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="wh_id" prop="whId">
<el-select
v-model="queryParams.whId"
placeholder="请选择仓库"
clearable
size="small"
style="width: 150px"
>
<el-option
v-for="dict in warehouseList"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<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="出库状态" prop="dealStatus">
<el-select v-model="queryParams.dealStatus" placeholder="请选择出库状态" clearable size="small" :maxlength="1">
<el-option
v-for="dict in dealStatusOption"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="确认状态" prop="sureStatus">
<el-select v-model="queryParams.sureStatus" placeholder="请选择确认状态" clearable size="small" :maxlength="1">
<el-option
v-for="dict in sureStatusOption"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="状态" prop="flag">
<el-select v-model="queryParams.flag" placeholder="请选择状态" clearable size="small">
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</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
:class="commonField.addClass"
:type="commonField.typePrimary"
:icon="commonField.addIcon"
:size="commonField.smallSize"
@click="handleAdd"
>新增</el-button>
<el-button
:class="commonField.exportClass"
:type="commonField.typeSuccess"
:icon="commonField.exportIcon"
:size="commonField.smallSize"
@click="handleExport"
>导出</el-button>
</el-form-item>
</div>
</el-form>
<div class="placeholder" />
<div style="padding:5px 10px">
<div class="mb12 font-small-bold">领用申请列表</div>
<el-table v-loading="loading" border :data="outcomeWmsApplyList">
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column label="pn" prop="pn" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.pn || '-' }}
</template>
</el-table-column>
<el-table-column label="qty" prop="qty" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.qty || '-' }}
</template>
</el-table-column>
<el-table-column label="wh_id" prop="whId" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.whId || '-' }}
</template>
</el-table-column>
<el-table-column label="ptype" prop="ptype" :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>-</span>
</template>
</el-table-column>
<el-table-column label="出库状态" prop="dealStatus" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.dealStatus === '1'">已出库</span>
<span v-else-if="scope.row.dealStatus === '0'">未出库</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="确认状态" prop="sureStatus" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.sureStatus === '1'">已确认</span>
<span v-else-if="scope.row.sureStatus === '0'">待确认</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column width="120" label="启用状态" prop="flag">
<template slot-scope="scope">
<el-switch
v-model="scope.row.flag"
class="switchDisabledStyle"
inactive-value="0"
active-value="1"
@click.native="handleStatusChange(scope.row)"
/>
</template>
</el-table-column>
<el-table-column label="备注" prop="remarks" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.remarks || '-' }}
</template>
</el-table-column>
<el-table-column label="创建时间" prop="createDate" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="200px">
<template slot-scope="scope">
<!-- <el-button-->
<!-- :class="commonField.updateClass"-->
<!-- :type="commonField.typeParent"-->
<!-- :size="commonField.size"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- >修改</el-button>-->
<el-button
:class="commonField.delClass"
:type="commonField.typeParent"
:size="commonField.size"
@click="handleDelete(scope.row)"
>删除</el-button>
</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="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="90px">
<el-form-item label="wh_id" prop="whId">
<el-select
v-model="form.whId"
placeholder="请选择仓库"
clearable
size="small"
style="width: 100%"
>
<el-option
v-for="dict in warehouseList"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="ptype" prop="ptype">
<el-select
v-model="form.ptype"
placeholder="请选择ptype值"
clearable
:maxlength="1"
size="small"
style="width: 100%"
>
<el-option
v-for="dict in addTypeOption"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="pn" prop="pn">
<el-input v-model.trim="form.pn" show-word-limit :maxlength="100" placeholder="请输入pn" />
</el-form-item>
<el-form-item label="qty" prop="qty">
<el-input v-model.trim="form.qty" placeholder="请输入qty的值" />
</el-form-item>
<el-form-item label="出库状态">
<el-radio-group v-model="form.dealStatus" show-word-limit :maxlength="1">
<el-radio label="1">已出库</el-radio>
<el-radio label="0">未出库</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="确认状态">
<el-radio-group v-model="form.sureStatus" show-word-limit :maxlength="1">
<el-radio label="1">已确认</el-radio>
<el-radio label="0">待确认</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="状态">
<el-radio-group v-model="form.flag">
<el-radio label="1">启用</el-radio>
<el-radio label="0">停用</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button class="cancelBtn" @click="cancel">取 消</el-button>
<el-button class="submitBtn" type="primary" @click="submitForm">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listOutcomeWmsApply,
getOutcomeWmsApply,
delOutcomeWmsApply,
addOutcomeWmsApply,
updateOutcomeWmsApply,
exportOutcomeWmsApply } from '@/api/outcomeWmsApply'
import commonField from '@/utils/commonField'
import { getDicts } from '@/api/system/dict/data'
export default {
name: 'OutcomeWmsApply',
data() {
return {
// 遮罩层
loading: true,
// 总条数
total: 0,
// ????表格数据
outcomeWmsApplyList: [],
warehouseList: [],
// 弹出层标题
title: '',
// 是否显示弹出层
open: false,
// 状态菜单
statusOptions: [
{
dictLabel: '启用',
dictValue: '1'
},
{
dictLabel: '停用',
dictValue: '0'
}
],
dealStatusOption: [
{
dictLabel: '已出库',
dictValue: '1'
},
{
dictLabel: '未出库',
dictValue: '0'
}
],
sureStatusOption: [
{
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'
}
],
addTypeOption: [
{
dictLabel: 'label',
dictValue: '2'
},
{
dictLabel: 'wd',
dictValue: '3'
},
{
dictLabel: 'sl',
dictValue: '4'
},
{
dictLabel: 'zd',
dictValue: '5'
}
],
// 查询参数
queryParams: {
page: 1,
rows: 10,
pn: undefined,
qty: undefined,
whId: undefined,
ptype: undefined,
dealStatus: undefined,
sureStatus: undefined,
flag: ''
},
// 表单参数
form: {
whId: '001',
pn: null,
qty: null,
dealStatus: '0',
sureStatus: '0',
ptype: '2'
},
// 表单校验
rules: {
}
}
},
computed: {
commonField() {
return commonField
}
},
created() {
this.getList() // 列表查询
this.getwareHouse()
},
methods: {
/** 查询????列表 */
getList() {
this.loading = true
listOutcomeWmsApply(this.queryParams).then(
response => {
this.outcomeWmsApplyList = response.rows
this.total = response.total
this.loading = false
}
)
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
this.form = {
businessId: undefined,
remarks: undefined,
pn: undefined,
qty: undefined,
whId: '001',
ptype: '2',
dealStatus: '0',
sureStatus: '0',
flag: '1'
}
this.resetForm('form')
},
/** 查询按钮操作 */
handleQuery() {
this.queryParams.page = 1
this.getList()
},
getwareHouse() {
getDicts('WAREHOUSE').then(res => {
console.log('仓库数据字典', res)
this.warehouseList = res.data
const whId = res.data[0].dictValue
this.form.whId = whId
})
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
page: 1,
rows: 10,
pn: undefined,
qty: undefined,
whId: undefined,
ptype: undefined,
dealStatus: undefined,
sureStatus: undefined,
flag: ''
}
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = '添加领用申请'
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.businessId
getOutcomeWmsApply(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 updateOutcomeWmsApply(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) {
updateOutcomeWmsApply(this.form).then(response => {
this.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
console.log(this.form)
addOutcomeWmsApply(this.form).then(response => {
this.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.businessId
this.$confirm('是否确认操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return delOutcomeWmsApply(id)
}).then(() => {
this.getList()
this.$message({
message: '删除成功',
type: 'success'
})
}).catch(function() {
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams
this.$confirm('是否确认操作?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return exportOutcomeWmsApply(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" scoped>
.app-container {
font-size: 18px;
padding: 0;
.placeholder {
height: 1.3vh;
background-color: #F4F4F4;
margin-bottom: 10px
}
}
</style>
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