线边库添加
This commit is contained in:
parent
b96f045ece
commit
efcae90344
@ -1,38 +1,38 @@
|
||||
module.exports = {
|
||||
// 超过最大值换行
|
||||
printWidth: 200,
|
||||
// 使用 2 个空格缩进
|
||||
tabWidth: 4,
|
||||
// 不使用缩进符,而使用空格
|
||||
useTabs: false,
|
||||
// 行尾不需要有分号
|
||||
semi: false,
|
||||
// 使用单引号
|
||||
singleQuote: true,
|
||||
// 对象的 key 仅在必要时用引号
|
||||
quoteProps: 'as-needed',
|
||||
// jsx 不使用单引号,而使用双引号
|
||||
jsxSingleQuote: false,
|
||||
// 多行时尽可能打印尾随逗号。(例如,单行数组永远不会出现逗号结尾。) 可选值"<none|es5|all>",默认none
|
||||
trailingComma: 'none',
|
||||
// 在对象,数组括号与文字之间加空格 "{ foo: bar }"
|
||||
bracketSpacing: true,
|
||||
// jsx 标签的反尖括号需要换行
|
||||
jsxBracketSameLine: false,
|
||||
bracketSameLine: false,
|
||||
// 箭头函数,always只有一个参数的时候,也需要括号,'avoid'箭头函数只有一个参数的时候可以忽略括号
|
||||
arrowParens: 'always',
|
||||
// 每个文件格式化的范围是文件的全部内容
|
||||
rangeStart: 0,
|
||||
rangeEnd: Infinity,
|
||||
// 不需要写文件开头的 @prettier
|
||||
requirePragma: false,
|
||||
// 不需要自动在文件开头插入 @prettier
|
||||
insertPragma: false,
|
||||
// 使用默认的折行标准
|
||||
proseWrap: 'preserve',
|
||||
// 根据显示样式决定 html 要不要折行
|
||||
htmlWhitespaceSensitivity: 'css',
|
||||
// 换行符使用 lf 结尾是 可选值"<auto|lf|crlf|cr>"
|
||||
endOfLine: 'auto'
|
||||
}
|
||||
// 超过最大值换行
|
||||
printWidth: 200,
|
||||
// 使用 2 个空格缩进
|
||||
tabWidth: 4,
|
||||
// 不使用缩进符,而使用空格
|
||||
useTabs: false,
|
||||
// 行尾不需要有分号
|
||||
semi: false,
|
||||
// 使用单引号
|
||||
singleQuote: true,
|
||||
// 对象的 key 仅在必要时用引号
|
||||
quoteProps: 'as-needed',
|
||||
// jsx 不使用单引号,而使用双引号
|
||||
jsxSingleQuote: false,
|
||||
// 多行时尽可能打印尾随逗号。(例如,单行数组永远不会出现逗号结尾。) 可选值"<none|es5|all>",默认none
|
||||
trailingComma: 'none',
|
||||
// 在对象,数组括号与文字之间加空格 "{ foo: bar }"
|
||||
bracketSpacing: true,
|
||||
// jsx 标签的反尖括号需要换行
|
||||
jsxBracketSameLine: false,
|
||||
bracketSameLine: false,
|
||||
// 箭头函数,always只有一个参数的时候,也需要括号,'avoid'箭头函数只有一个参数的时候可以忽略括号
|
||||
arrowParens: 'always',
|
||||
// 每个文件格式化的范围是文件的全部内容
|
||||
rangeStart: 0,
|
||||
rangeEnd: Infinity,
|
||||
// 不需要写文件开头的 @prettier
|
||||
requirePragma: false,
|
||||
// 不需要自动在文件开头插入 @prettier
|
||||
insertPragma: false,
|
||||
// 使用默认的折行标准
|
||||
proseWrap: 'preserve',
|
||||
// 根据显示样式决定 html 要不要折行
|
||||
htmlWhitespaceSensitivity: 'css',
|
||||
// 换行符使用 lf 结尾是 可选值"<auto|lf|crlf|cr>"
|
||||
endOfLine: 'auto'
|
||||
}
|
||||
|
||||
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@ -11,7 +11,7 @@
|
||||
"vue"
|
||||
],
|
||||
"[vue]": {
|
||||
"editor.defaultFormatter": "octref.vetur"
|
||||
"editor.defaultFormatter": "Vue.volar"
|
||||
},
|
||||
"[scss]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
|
||||
57
src/api/materialManagement/lineWarehouse/mmlineinventory.js
Normal file
57
src/api/materialManagement/lineWarehouse/mmlineinventory.js
Normal file
@ -0,0 +1,57 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 线边库库存分页查询
|
||||
* @param {查询条件} data
|
||||
*/
|
||||
export function listMmLineInventory(query) {
|
||||
return request({
|
||||
url: 'mes/materialManagement/MmLineInventory/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增线边库库存
|
||||
* @param data
|
||||
*/
|
||||
export function addMmLineInventory(data) {
|
||||
return request({
|
||||
url: 'mes/materialManagement/MmLineInventory',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 修改线边库库存
|
||||
* @param data
|
||||
*/
|
||||
export function updateMmLineInventory(data) {
|
||||
return request({
|
||||
url: 'mes/materialManagement/MmLineInventory',
|
||||
method: 'PUT',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 获取线边库库存详情
|
||||
* @param {Id}
|
||||
*/
|
||||
export function getMmLineInventory(id) {
|
||||
return request({
|
||||
url: 'mes/materialManagement/MmLineInventory/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除线边库库存
|
||||
* @param {主键} pid
|
||||
*/
|
||||
export function delMmLineInventory(pid) {
|
||||
return request({
|
||||
url: 'mes/materialManagement/MmLineInventory/' + pid,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
57
src/api/materialManagement/lineWarehouse/mmlinelocation.js
Normal file
57
src/api/materialManagement/lineWarehouse/mmlinelocation.js
Normal file
@ -0,0 +1,57 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 线边库库位分页查询
|
||||
* @param {查询条件} data
|
||||
*/
|
||||
export function listMmLineLocation(query) {
|
||||
return request({
|
||||
url: 'mes/materialManagement/MmLineLocation/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增线边库库位
|
||||
* @param data
|
||||
*/
|
||||
export function addMmLineLocation(data) {
|
||||
return request({
|
||||
url: 'mes/materialManagement/MmLineLocation',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 修改线边库库位
|
||||
* @param data
|
||||
*/
|
||||
export function updateMmLineLocation(data) {
|
||||
return request({
|
||||
url: 'mes/materialManagement/MmLineLocation',
|
||||
method: 'PUT',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 获取线边库库位详情
|
||||
* @param {Id}
|
||||
*/
|
||||
export function getMmLineLocation(id) {
|
||||
return request({
|
||||
url: 'mes/materialManagement/MmLineLocation/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除线边库库位
|
||||
* @param {主键} pid
|
||||
*/
|
||||
export function delMmLineLocation(pid) {
|
||||
return request({
|
||||
url: 'mes/materialManagement/MmLineLocation/' + pid,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 线边库出入库日志分页查询
|
||||
* @param {查询条件} data
|
||||
*/
|
||||
export function listMmLineTransactionLog(query) {
|
||||
return request({
|
||||
url: 'mes/materialManagement/MmLineTransactionLog/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增线边库出入库日志
|
||||
* @param data
|
||||
*/
|
||||
export function addMmLineTransactionLog(data) {
|
||||
return request({
|
||||
url: 'mes/materialManagement/MmLineTransactionLog',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 修改线边库出入库日志
|
||||
* @param data
|
||||
*/
|
||||
export function updateMmLineTransactionLog(data) {
|
||||
return request({
|
||||
url: 'mes/materialManagement/MmLineTransactionLog',
|
||||
method: 'PUT',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 获取线边库出入库日志详情
|
||||
* @param {Id}
|
||||
*/
|
||||
export function getMmLineTransactionLog(id) {
|
||||
return request({
|
||||
url: 'mes/materialManagement/MmLineTransactionLog/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除线边库出入库日志
|
||||
* @param {主键} pid
|
||||
*/
|
||||
export function delMmLineTransactionLog(pid) {
|
||||
return request({
|
||||
url: 'mes/materialManagement/MmLineTransactionLog/' + pid,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
* @Descripttion: (线边库库存/mm_linesidebar_inventory)
|
||||
* @Descripttion: (库存盘点)
|
||||
* @Author: (admin)
|
||||
* @Date: (2024-11-16)
|
||||
-->
|
||||
@ -0,0 +1,310 @@
|
||||
<!--
|
||||
* @Descripttion: (线边库位/线边库位)
|
||||
* @Author: (admin)
|
||||
* @Date: (2025-03-21)
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<el-form :model="queryParams" label-position="right" inline ref="queryRef" v-show="showSearch" @submit.prevent>
|
||||
<el-form-item label="线别" prop="lineCode">
|
||||
<el-select v-model="queryParams.lineCode" placeholder="全部">
|
||||
<el-option label="全部" value="" />
|
||||
<el-option v-for="(item, index) in allRouteOptions" :key="index" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="handleQuery">{{ $t('btn.search') }}</el-button>
|
||||
<el-button icon="refresh" @click="resetQuery">{{ $t('btn.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- 工具区域 -->
|
||||
<el-row :gutter="15" class="mb10">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" v-hasPermi="['business:mmlinelocation:add']" plain icon="plus" @click="handleAdd">
|
||||
{{ $t('btn.add') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table :data="dataList" v-loading="loading" ref="table" border header-cell-class-name="el-table-header-cell"
|
||||
highlight-current-row @sort-change="sortChange">
|
||||
<el-table-column prop="linecode" label="线别" align="center" v-if="columns.showColumn('linecode')" />
|
||||
<el-table-column prop="locationName" label="库位名称" align="center" v-if="columns.showColumn('locationName')" />
|
||||
<el-table-column prop="locationCode" label="库位编号" align="center" v-if="columns.showColumn('locationCode')" />
|
||||
<el-table-column prop="description" label="库位的描述信息" align="center" v-if="columns.showColumn('description')" />
|
||||
<el-table-column prop="capacity" label="库位容量" align="center" v-if="columns.showColumn('capacity')" />
|
||||
<el-table-column prop="status" label="库位状态" align="center" v-if="columns.showColumn('status')">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="options.statusOptions" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="160">
|
||||
<template #default="scope">
|
||||
<el-button type="success" size="small" icon="edit" title="编辑" v-hasPermi="['business:mmlinelocation:edit']"
|
||||
@click="handleUpdate(scope.row)"></el-button>
|
||||
<el-button type="danger" size="small" icon="delete" title="删除" v-hasPermi="['business:mmlinelocation:delete']"
|
||||
@click="handleDelete(scope.row)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
|
||||
<!-- 添加或修改线边库位对话框 -->
|
||||
<el-dialog :title="title" :lock-scroll="false" v-model="open">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="线别" prop="lineCode">
|
||||
<el-select v-model="form.lineCode">
|
||||
<el-option v-for="(item, index) in allRouteOptions" :key="index" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="库位名称" prop="locationName">
|
||||
<el-input v-model="form.locationName" placeholder="请输入库位名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="库位编号" prop="locationCode">
|
||||
<el-input v-model="form.locationCode" placeholder="请输入库位编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="库位容量" prop="capacity">
|
||||
<el-input v-model.number="form.capacity" placeholder="请输入库位容量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="24">
|
||||
<el-form-item label="库位描述" prop="description">
|
||||
<el-input type="textarea" v-model="form.description" placeholder="库位描述" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="24">
|
||||
<el-form-item label="库位状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio v-for="item in options.statusOptions" :key="item.dictValue" :label="parseInt(item.dictValue)">
|
||||
{{ item.dictLabel }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer v-if="opertype != 3">
|
||||
<el-button text @click="cancel">{{ $t('btn.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="submitForm">{{ $t('btn.submit') }}</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="mmlinelocation">
|
||||
import {
|
||||
listMmLineLocation,
|
||||
addMmLineLocation, delMmLineLocation,
|
||||
updateMmLineLocation, getMmLineLocation,
|
||||
}
|
||||
from '@/api/materialManagement/lineWarehouse/mmlinelocation.js'
|
||||
const { proxy } = getCurrentInstance()
|
||||
const ids = ref([])
|
||||
const loading = ref(false)
|
||||
const showSearch = ref(true)
|
||||
const queryParams = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
sort: '',
|
||||
sortType: 'asc',
|
||||
})
|
||||
const columns = ref([
|
||||
{ visible: true, prop: 'locationName', label: '库位名称' },
|
||||
{ visible: true, prop: 'locationCode', label: '库位编号' },
|
||||
{ visible: true, prop: 'linecode', label: '线别' },
|
||||
{ visible: true, prop: 'description', label: '库位的描述信息' },
|
||||
{ visible: true, prop: 'capacity', label: '库位容量' },
|
||||
{ visible: true, prop: 'status', label: '库位状态(如可用、禁用等)' },
|
||||
])
|
||||
const total = ref(0)
|
||||
const dataList = ref([])
|
||||
const queryRef = ref()
|
||||
const defaultTime = ref([new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)])
|
||||
|
||||
|
||||
var dictParams = [
|
||||
]
|
||||
|
||||
|
||||
function getList() {
|
||||
loading.value = true
|
||||
listMmLineLocation(queryParams).then(res => {
|
||||
const { code, data } = res
|
||||
if (code == 200) {
|
||||
dataList.value = data.result
|
||||
total.value = data.totalNum
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 查询
|
||||
function handleQuery() {
|
||||
queryParams.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
// 重置查询操作
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef")
|
||||
handleQuery()
|
||||
}
|
||||
// 自定义排序
|
||||
function sortChange(column) {
|
||||
var sort = undefined
|
||||
var sortType = undefined
|
||||
|
||||
if (column.prop != null && column.order != null) {
|
||||
sort = column.prop
|
||||
sortType = column.order
|
||||
|
||||
}
|
||||
queryParams.sort = sort
|
||||
queryParams.sortType = sortType
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/*************** form操作 ***************/
|
||||
const formRef = ref()
|
||||
const title = ref('')
|
||||
// 操作类型 1、add 2、edit 3、view
|
||||
const opertype = ref(0)
|
||||
const open = ref(false)
|
||||
const state = reactive({
|
||||
single: true,
|
||||
multiple: true,
|
||||
form: {},
|
||||
rules: {
|
||||
lineCode: [{ required: true, message: "线别不能为空", trigger: "blur" }],
|
||||
locationName: [{ required: true, message: "库位名称不能为空", trigger: "blur" }],
|
||||
locationCode: [{ required: true, message: "库位编号不能为空", trigger: "blur" }],
|
||||
},
|
||||
options: {
|
||||
// 库位状态 选项列表 格式 eg:{ dictLabel: '标签', dictValue: '0'}
|
||||
statusOptions: [
|
||||
{ dictLabel: '可用', dictValue: '1', listClass: 'success' },
|
||||
{ dictLabel: '禁用', dictValue: '0', listClass: 'danger' }
|
||||
],
|
||||
}
|
||||
})
|
||||
|
||||
const { form, rules, options, single, multiple } = toRefs(state)
|
||||
|
||||
// 关闭dialog
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 重置表单
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
locationName: null,
|
||||
locationCode: null,
|
||||
linecode: null,
|
||||
description: null,
|
||||
capacity: 0,
|
||||
status: 1,
|
||||
};
|
||||
proxy.resetForm("formRef")
|
||||
}
|
||||
// 添加按钮操作
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true
|
||||
title.value = '添加线边库位'
|
||||
opertype.value = 1
|
||||
}
|
||||
// 修改按钮操作
|
||||
function handleUpdate(row) {
|
||||
reset()
|
||||
const id = row.id || ids.value
|
||||
getMmLineLocation(id).then((res) => {
|
||||
const { code, data } = res
|
||||
if (code == 200) {
|
||||
open.value = true
|
||||
title.value = '修改线边库位'
|
||||
opertype.value = 2
|
||||
|
||||
form.value = {
|
||||
...data,
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 添加&修改 表单提交
|
||||
function submitForm() {
|
||||
proxy.$refs["formRef"].validate((valid) => {
|
||||
if (valid) {
|
||||
|
||||
if (form.value.id != undefined && opertype.value === 2) {
|
||||
updateMmLineLocation(form.value).then((res) => {
|
||||
proxy.$modal.msgSuccess("修改成功")
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addMmLineLocation(form.value).then((res) => {
|
||||
proxy.$modal.msgSuccess("新增成功")
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除按钮操作
|
||||
function handleDelete(row) {
|
||||
const Ids = row.id || ids.value
|
||||
|
||||
proxy
|
||||
.$confirm('是否确认删除参数编号为"' + Ids + '"的数据项?')
|
||||
.then(function () {
|
||||
return delMmLineLocation(Ids)
|
||||
})
|
||||
.then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess("删除成功")
|
||||
})
|
||||
}
|
||||
|
||||
// =========== 获取所有线别 ==========
|
||||
import { GetAllRoute } from '@/api/productManagement/proworkorder.js'
|
||||
const allRouteOptions = ref([])
|
||||
function getAllRouteOptions() {
|
||||
GetAllRoute().then((res) => {
|
||||
if (res.code === 200) {
|
||||
allRouteOptions.value = res.data.map((item) => {
|
||||
return {
|
||||
id: item.id,
|
||||
label: `${item.code}-${item.name}`,
|
||||
value: `${item.code}`
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
getAllRouteOptions()
|
||||
// ==================================
|
||||
|
||||
|
||||
|
||||
|
||||
// handleQuery()
|
||||
</script>
|
||||
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
* @Descripttion: (线边库库存/mm_linesidebar_inventory)
|
||||
* @Descripttion: (线边库库存)
|
||||
* @Author: (admin)
|
||||
* @Date: (2024-11-16)
|
||||
-->
|
||||
@ -9,7 +9,8 @@
|
||||
<el-form-item label="线别" prop="lineCode">
|
||||
<el-select v-model="queryParams.lineCode" placeholder="全部">
|
||||
<el-option label="全部" value="" />
|
||||
<el-option v-for="(item, index) in allRouteOptions" :key="index" :label="item.label" :value="item.value" />
|
||||
<el-option v-for="(item, index) in allRouteOptions" :key="index" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@ -24,37 +25,54 @@
|
||||
{{ $t('btn.add') }}
|
||||
</el-button>
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="warning" icon="MessageBox" @click="handleAdd"> 仓库盘点 </el-button>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" icon="MessageBox" @click="getList"> 仓库盘点 </el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" icon="download" @click="handleAdd"> 导出盘点清单 </el-button>
|
||||
</el-col> -->
|
||||
<el-button type="info" icon="download" @click="getList"> 导出盘点清单 </el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table :data="dataList" v-loading="loading" ref="table" border header-cell-class-name="el-table-header-cell" highlight-current-row @sort-change="sortChange">
|
||||
<el-table-column prop="id" label="雪花id" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('id')" />
|
||||
<el-table-column prop="lineCode" label="产线编号" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('lineCode')" />
|
||||
<el-table-column prop="lineName" label="产线名称" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('lineName')" />
|
||||
<el-table-column prop="materialCode" label="物料编号" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('materialCode')" />
|
||||
<el-table-column prop="materialName" label="物料名称" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('materialName')" />
|
||||
<el-table-column prop="logicQuantity" label="现有库存" align="center" v-if="columns.showColumn('logicQuantity')" />
|
||||
<el-table-column prop="actualQuantity" label="上次盘点库存" align="center" v-if="columns.showColumn('actualQuantity')" />
|
||||
<el-table-column prop="remark" label="备注" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('remark')" />
|
||||
<el-table-column prop="createdBy" label="创建人" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('createdBy')" />
|
||||
<el-table-column prop="createdTime" label="创建时间" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('createdTime')" />
|
||||
<el-table-column prop="updatedBy" label="更新人" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('updatedBy')" />
|
||||
<el-table-column prop="updatedTime" label="更新时间" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('updatedTime')" />
|
||||
<el-table :data="dataList" v-loading="loading" ref="table" border header-cell-class-name="el-table-header-cell"
|
||||
highlight-current-row @sort-change="sortChange">
|
||||
<el-table-column prop="id" label="雪花id" align="center" :show-overflow-tooltip="true"
|
||||
v-if="columns.showColumn('id')" />
|
||||
<el-table-column prop="lineCode" label="产线编号" align="center" :show-overflow-tooltip="true"
|
||||
v-if="columns.showColumn('lineCode')" />
|
||||
<el-table-column prop="lineName" label="产线名称" align="center" :show-overflow-tooltip="true"
|
||||
v-if="columns.showColumn('lineName')" />
|
||||
<el-table-column prop="materialCode" label="物料编号" align="center" :show-overflow-tooltip="true"
|
||||
v-if="columns.showColumn('materialCode')" />
|
||||
<el-table-column prop="materialName" label="物料名称" align="center" :show-overflow-tooltip="true"
|
||||
v-if="columns.showColumn('materialName')" />
|
||||
<el-table-column prop="logicQuantity" label="现有库存" align="center"
|
||||
v-if="columns.showColumn('logicQuantity')" />
|
||||
<el-table-column prop="actualQuantity" label="上次盘点库存" align="center"
|
||||
v-if="columns.showColumn('actualQuantity')" />
|
||||
<el-table-column prop="remark" label="备注" align="center" :show-overflow-tooltip="true"
|
||||
v-if="columns.showColumn('remark')" />
|
||||
<el-table-column prop="createdBy" label="创建人" align="center" :show-overflow-tooltip="true"
|
||||
v-if="columns.showColumn('createdBy')" />
|
||||
<el-table-column prop="createdTime" label="创建时间" align="center" :show-overflow-tooltip="true"
|
||||
v-if="columns.showColumn('createdTime')" />
|
||||
<el-table-column prop="updatedBy" label="更新人" align="center" :show-overflow-tooltip="true"
|
||||
v-if="columns.showColumn('updatedBy')" />
|
||||
<el-table-column prop="updatedTime" label="更新时间" align="center" :show-overflow-tooltip="true"
|
||||
v-if="columns.showColumn('updatedTime')" />
|
||||
<el-table-column label="操作" width="160">
|
||||
<template #default="scope">
|
||||
<el-button type="warning" size="small" icon="MessageBox" @click="handleUpdate(scope.row)">盘点</el-button>
|
||||
<el-button type="warning" size="small" icon="MessageBox"
|
||||
@click="handleUpdate(scope.row)">盘点</el-button>
|
||||
<!-- <el-button type="success" size="small" icon="edit" title="编辑" v-hasPermi="['business:mmlinesidebarinventory:edit']" @click="handleUpdate(scope.row)"></el-button> -->
|
||||
<el-button type="danger" size="small" icon="delete" title="删除" v-hasPermi="['business:mmlinesidebarinventory:delete']" @click="handleDelete(scope.row)"></el-button>
|
||||
<el-button type="danger" size="small" icon="delete" title="删除"
|
||||
v-hasPermi="['business:mmlinesidebarinventory:delete']"
|
||||
@click="handleDelete(scope.row)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 添加或修改线边库库存对话框 -->
|
||||
<el-dialog :title="title" :lock-scroll="false" v-model="open">
|
||||
@ -113,12 +131,12 @@
|
||||
|
||||
<script setup name="mmlinesidebarinventory">
|
||||
import {
|
||||
listMmLinesidebarInventory,
|
||||
addMmLinesidebarInventory,
|
||||
delMmLinesidebarInventory,
|
||||
updateMmLinesidebarInventory,
|
||||
getMmLinesidebarInventory
|
||||
} from '@/api/materialManagement/mmlinesidebarinventory.js'
|
||||
listMmLineInventory,
|
||||
addMmLineInventory,
|
||||
delMmLineInventory,
|
||||
updateMmLineInventory,
|
||||
getMmLineInventory
|
||||
} from '@/api/materialManagement//mmlineinventory.js'
|
||||
const { proxy } = getCurrentInstance()
|
||||
const ids = ref([])
|
||||
const loading = ref(false)
|
||||
@ -169,7 +187,7 @@ getAllRouteOptions()
|
||||
// ==================================
|
||||
function getList() {
|
||||
loading.value = true
|
||||
listMmLinesidebarInventory(queryParams).then((res) => {
|
||||
listMmLineInventory(queryParams).then((res) => {
|
||||
const { code, data } = res
|
||||
if (code == 200) {
|
||||
dataList.value = data.result
|
||||
@ -256,7 +274,7 @@ function handleAdd() {
|
||||
function handleUpdate(row) {
|
||||
reset()
|
||||
const id = row.id || ids.value
|
||||
getMmLinesidebarInventory(id).then((res) => {
|
||||
getMmLineInventory(id).then((res) => {
|
||||
const { code, data } = res
|
||||
if (code == 200) {
|
||||
open.value = true
|
||||
@ -275,13 +293,13 @@ function submitForm() {
|
||||
proxy.$refs['formRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.id != undefined && opertype.value === 2) {
|
||||
updateMmLinesidebarInventory(form.value).then((res) => {
|
||||
updateMmLineInventory(form.value).then((res) => {
|
||||
proxy.$modal.msgSuccess('修改成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addMmLinesidebarInventory(form.value).then((res) => {
|
||||
addMmLineInventory(form.value).then((res) => {
|
||||
proxy.$modal.msgSuccess('新增成功')
|
||||
open.value = false
|
||||
getList()
|
||||
@ -298,7 +316,7 @@ function handleDelete(row) {
|
||||
proxy
|
||||
.$confirm('是否确认删除参数编号为"' + Ids + '"的数据项?')
|
||||
.then(function () {
|
||||
return delMmLinesidebarInventory(Ids)
|
||||
return delMmLineInventory(Ids)
|
||||
})
|
||||
.then(() => {
|
||||
getList()
|
||||
@ -306,5 +324,5 @@ function handleDelete(row) {
|
||||
})
|
||||
}
|
||||
|
||||
handleQuery()
|
||||
// handleQuery()
|
||||
</script>
|
||||
|
||||
@ -1,11 +1,18 @@
|
||||
<!--
|
||||
* @Descripttion: (线边库出入库日志/mm_linesidebar_inventory_outbound_and_inbound)
|
||||
* @Descripttion: (线边库出入库日志)
|
||||
* @Author: (admin)
|
||||
* @Date: (2024-11-16)
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<el-form :model="queryParams" label-position="right" inline ref="queryRef" v-show="showSearch" @submit.prevent>
|
||||
<el-form-item label="线别" prop="lineCode">
|
||||
<el-select v-model="queryParams.lineCode" placeholder="全部">
|
||||
<el-option label="全部" value="" />
|
||||
<el-option v-for="(item, index) in allRouteOptions" :key="index" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="handleQuery">{{ $t('btn.search') }}</el-button>
|
||||
<el-button icon="refresh" @click="resetQuery">{{ $t('btn.reset') }}</el-button>
|
||||
@ -13,56 +20,51 @@
|
||||
</el-form>
|
||||
<!-- 工具区域 -->
|
||||
<el-row :gutter="15" class="mb10">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" v-hasPermi="['business:mmlinesidebarinventoryoutboundandinbound:add']" plain icon="plus" @click="handleAdd">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="primary" v-hasPermi="['business:mmlinesidebarinventoryoutboundandinbound:add']" plain
|
||||
icon="plus" @click="handleAdd">
|
||||
{{ $t('btn.add') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table :data="dataList" v-loading="loading" ref="table" border header-cell-class-name="el-table-header-cell" highlight-current-row @sort-change="sortChange">
|
||||
<el-table-column prop="id" label="雪花" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('id')" />
|
||||
<el-table-column prop="lineCode" label="线别" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('lineCode')" />
|
||||
<el-table-column prop="materialCode" label="物料编号" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('materialCode')" />
|
||||
<el-table-column prop="materialName" label="物料名称" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('materialName')" />
|
||||
<el-table-column prop="action" label="操作" align="center" v-if="columns.showColumn('action')">
|
||||
<el-table :data="dataList" v-loading="loading" ref="table" border header-cell-class-name="el-table-header-cell"
|
||||
highlight-current-row @sort-change="sortChange">
|
||||
<el-table-column prop="lineCode" label="线别" align="center" v-if="columns.showColumn('lineCode')" />
|
||||
<el-table-column prop="materialCode" label="物料编号" align="center"
|
||||
v-if="columns.showColumn('materialCode')" />
|
||||
<el-table-column prop="materialName" label="物料名称" align="center"
|
||||
v-if="columns.showColumn('materialName')" />
|
||||
<el-table-column prop="transactionType" label="操作类别" align="center"
|
||||
v-if="columns.showColumn('transactionType')">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.action == 1" type="primary">出库</el-tag>
|
||||
<el-tag v-if="scope.row.action == 2" type="warning">取消出库</el-tag>
|
||||
<el-tag v-if="scope.row.action == 3" type="success">入库</el-tag>
|
||||
<el-tag v-if="scope.row.action == 4" type="warning">取消入库</el-tag>
|
||||
<el-tag v-if="scope.row.action == -1" type="danger">异常</el-tag>
|
||||
<el-tag v-if="scope.row.transactionType == 1" type="primary">出库</el-tag>
|
||||
<el-tag v-if="scope.row.transactionType == 2" type="warning">取消出库</el-tag>
|
||||
<el-tag v-if="scope.row.transactionType == 3" type="success">入库</el-tag>
|
||||
<el-tag v-if="scope.row.transactionType == 4" type="warning">取消入库</el-tag>
|
||||
<el-tag v-if="scope.row.transactionType == -1" type="danger">异常</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="quantity" label="数量" align="center" v-if="columns.showColumn('quantity')" />
|
||||
<el-table-column prop="remark" label="备注" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('remark')" />
|
||||
<el-table-column prop="createdBy" label="创建人" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('createdBy')" />
|
||||
<el-table-column prop="createdTime" label="创建时间" :show-overflow-tooltip="true" v-if="columns.showColumn('createdTime')" />
|
||||
<el-table-column prop="updatedBy" label="更新人" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('updatedBy')" />
|
||||
<el-table-column prop="updatedTime" label="更新时间" :show-overflow-tooltip="true" v-if="columns.showColumn('updatedTime')" />
|
||||
<el-table-column prop="quantity" label="操作数量" align="center" v-if="columns.showColumn('quantity')" />
|
||||
<el-table-column prop="remark" label="备注" align="center" v-if="columns.showColumn('remark')" />
|
||||
<el-table-column prop="createdBy" label="创建人" align="center" v-if="columns.showColumn('createdBy')" />
|
||||
<el-table-column prop="createdTime" label="创建时间" v-if="columns.showColumn('createdTime')" />
|
||||
<el-table-column prop="updatedBy" label="更新人" align="center" v-if="columns.showColumn('updatedBy')" />
|
||||
<el-table-column prop="updatedTime" label="更新时间" v-if="columns.showColumn('updatedTime')" />
|
||||
<el-table-column label="操作" width="160">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="success"
|
||||
size="small"
|
||||
icon="edit"
|
||||
title="编辑"
|
||||
<el-button type="success" size="small" icon="edit" title="编辑"
|
||||
v-hasPermi="['business:mmlinesidebarinventoryoutboundandinbound:edit']"
|
||||
@click="handleUpdate(scope.row)"
|
||||
></el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
icon="delete"
|
||||
title="删除"
|
||||
@click="handleUpdate(scope.row)"></el-button>
|
||||
<el-button type="danger" size="small" icon="delete" title="删除"
|
||||
v-hasPermi="['business:mmlinesidebarinventoryoutboundandinbound:delete']"
|
||||
@click="handleDelete(scope.row)"
|
||||
></el-button>
|
||||
@click="handleDelete(scope.row)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 添加或修改线边库出入库日志对话框 -->
|
||||
<el-dialog :title="title" :lock-scroll="false" v-model="open">
|
||||
@ -87,8 +89,8 @@
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="操作" prop="action">
|
||||
<el-input v-model.number="form.action" placeholder="请输入操作" />
|
||||
<el-form-item label="操作" prop="transactionType">
|
||||
<el-input v-model.number="form.transactionType" placeholder="请输入操作" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@ -112,14 +114,14 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="mmlinesidebarinventoryoutboundandinbound">
|
||||
<script setup name="mmlinetransactionlog">
|
||||
import {
|
||||
listMmLinesidebarInventoryOutboundAndInbound,
|
||||
addMmLinesidebarInventoryOutboundAndInbound,
|
||||
delMmLinesidebarInventoryOutboundAndInbound,
|
||||
updateMmLinesidebarInventoryOutboundAndInbound,
|
||||
getMmLinesidebarInventoryOutboundAndInbound
|
||||
} from '@/api/materialManagement/mmlinesidebarinventoryoutboundandinbound.js'
|
||||
listMmLineTransactionLog,
|
||||
addMmLineTransactionLog,
|
||||
delMmLineTransactionLog,
|
||||
updateMmLineTransactionLog,
|
||||
getMmLineTransactionLog
|
||||
} from '@/api/materialManagement/lineWarehouse/mmlinetransactionlog.js'
|
||||
const { proxy } = getCurrentInstance()
|
||||
const ids = ref([])
|
||||
const loading = ref(false)
|
||||
@ -135,7 +137,7 @@ const columns = ref([
|
||||
{ visible: true, prop: 'lineCode', label: '线别' },
|
||||
{ visible: true, prop: 'materialCode', label: '物料编号' },
|
||||
{ visible: true, prop: 'materialName', label: '物料名称' },
|
||||
{ visible: true, prop: 'action', label: '操作' },
|
||||
{ visible: true, prop: 'transactionType', label: '操作' },
|
||||
{ visible: true, prop: 'quantity', label: '数量' },
|
||||
{ visible: true, prop: 'remark', label: '备注' },
|
||||
{ visible: true, prop: 'createdBy', label: '创建人' },
|
||||
@ -152,7 +154,7 @@ var dictParams = []
|
||||
|
||||
function getList() {
|
||||
loading.value = true
|
||||
listMmLinesidebarInventoryOutboundAndInbound(queryParams).then((res) => {
|
||||
listMmLineTransactionLog(queryParams).then((res) => {
|
||||
const { code, data } = res
|
||||
if (code == 200) {
|
||||
dataList.value = data.result
|
||||
@ -218,7 +220,7 @@ function reset() {
|
||||
lineCode: null,
|
||||
materialCode: null,
|
||||
materialName: null,
|
||||
action: null,
|
||||
transactionType: null,
|
||||
quantity: null,
|
||||
createdBy: null,
|
||||
createdTime: null,
|
||||
@ -238,7 +240,7 @@ function handleAdd() {
|
||||
function handleUpdate(row) {
|
||||
reset()
|
||||
const id = row.id || ids.value
|
||||
getMmLinesidebarInventoryOutboundAndInbound(id).then((res) => {
|
||||
getMmLineTransactionLog(id).then((res) => {
|
||||
const { code, data } = res
|
||||
if (code == 200) {
|
||||
open.value = true
|
||||
@ -257,13 +259,13 @@ function submitForm() {
|
||||
proxy.$refs['formRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.id != undefined && opertype.value === 2) {
|
||||
updateMmLinesidebarInventoryOutboundAndInbound(form.value).then((res) => {
|
||||
updateMmLineTransactionLog(form.value).then((res) => {
|
||||
proxy.$modal.msgSuccess('修改成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addMmLinesidebarInventoryOutboundAndInbound(form.value).then((res) => {
|
||||
addMmLineTransactionLog(form.value).then((res) => {
|
||||
proxy.$modal.msgSuccess('新增成功')
|
||||
open.value = false
|
||||
getList()
|
||||
@ -280,7 +282,7 @@ function handleDelete(row) {
|
||||
proxy
|
||||
.$confirm('是否确认删除参数编号为"' + Ids + '"的数据项?')
|
||||
.then(function () {
|
||||
return delMmLinesidebarInventoryOutboundAndInbound(Ids)
|
||||
return delMmLineTransactionLog(Ids)
|
||||
})
|
||||
.then(() => {
|
||||
getList()
|
||||
@ -288,5 +290,26 @@ function handleDelete(row) {
|
||||
})
|
||||
}
|
||||
|
||||
handleQuery()
|
||||
|
||||
|
||||
// =========== 获取所有线别 ==========
|
||||
import { GetAllRoute } from '@/api/productManagement/proworkorder.js'
|
||||
const allRouteOptions = ref([])
|
||||
function getAllRouteOptions() {
|
||||
GetAllRoute().then((res) => {
|
||||
if (res.code === 200) {
|
||||
allRouteOptions.value = res.data.map((item) => {
|
||||
return {
|
||||
id: item.id,
|
||||
label: `${item.code}-${item.name}`,
|
||||
value: `${item.code}`
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
getAllRouteOptions()
|
||||
// ==================================
|
||||
|
||||
// handleQuery()
|
||||
</script>
|
||||
|
||||
@ -1,378 +0,0 @@
|
||||
<!--
|
||||
* @Descripttion: (车间呆滞品盘点/mm_slow_move_material)
|
||||
* @Author: (admin)
|
||||
* @Date: (2024-11-12)
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<el-form :model="queryParams" label-position="right" inline ref="queryRef" v-show="showSearch" @submit.prevent>
|
||||
<el-form-item label="物料号" prop="materialCode">
|
||||
<el-input v-model="queryParams.mapaterialCode" placeholder="请输入物料号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="materialName">
|
||||
<el-input v-model="queryParams.materialName" placeholder="请输入物料名称" />
|
||||
</el-form-item>
|
||||
<!--
|
||||
<el-form-item label="组别" prop="groupCode">
|
||||
<el-select v-model="queryParams.groupCode" placeholder="全部">
|
||||
<el-option label="全部" value="" />
|
||||
<el-option v-for="(item, index) in allGroupOptions" :key="index" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="线别" prop="lineCode">
|
||||
<el-select v-model="queryParams.lineCode" placeholder="全部">
|
||||
<el-option label="全部" value="" />
|
||||
<el-option v-for="(item, index) in allRouteOptions" :key="index" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="筛选日期" prop="checkDateArray">
|
||||
<el-date-picker v-model="queryParams.checkDateArray" type="daterange" range-separator="到" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="请选择日期区间" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="search" type="primary" @click="handleQuery">{{ $t('btn.search') }}</el-button>
|
||||
<el-button icon="refresh" @click="resetQuery">{{ $t('btn.reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- 工具区域 -->
|
||||
<el-row :gutter="15" class="mb10">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="primary" v-hasPermi="['business:mmslowmovematerial:add']" plain icon="plus" @click="handleAdd">
|
||||
{{ $t('btn.add') }}
|
||||
</el-button>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" v-hasPermi="['business:mmslowmovematerial:add']" plain @click="generateDialogShow"> 呆滞品数据生成 </el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table :data="dataList" v-loading="loading" ref="table" border header-cell-class-name="el-table-header-cell" highlight-current-row @sort-change="sortChange">
|
||||
<el-table-column prop="id" label="雪花" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('id')" />
|
||||
<el-table-column prop="lineCode" width="60" label="线别" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('lineCode')" />
|
||||
<el-table-column prop="materialCode" label="物料编号" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('materialCode')" />
|
||||
<el-table-column prop="materialName" min-width="140" label="物料名称" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('materialName')" />
|
||||
<el-table-column prop="specification" label="规格" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('specification')" />
|
||||
<el-table-column prop="reportConsume" label="报工消耗量" align="center" v-if="columns.showColumn('reportConsume')" />
|
||||
<el-table-column prop="warehouseDeliveryConsume" width="140" label="仓库发货消耗量" align="center" v-if="columns.showColumn('warehouseDeliveryConsume')" />
|
||||
<el-table-column prop="logicQuantity" label="理论呆滞数量" align="center" v-if="columns.showColumn('logicQuantity')" />
|
||||
<el-table-column prop="actualQuantity" label="实际盘点数量" align="center" v-if="columns.showColumn('actualQuantity')" />
|
||||
<el-table-column prop="checkDate" label="盘点时间" :show-overflow-tooltip="true" v-if="columns.showColumn('checkDate')" />
|
||||
<el-table-column prop="unit" label="单位" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('unit')" />
|
||||
<el-table-column prop="createdBy" label="创建人" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('createdBy')" />
|
||||
<el-table-column prop="createdTime" label="创建时间" :show-overflow-tooltip="true" v-if="columns.showColumn('createdTime')" />
|
||||
<el-table-column prop="updatedBy" label="修改人" align="center" :show-overflow-tooltip="true" v-if="columns.showColumn('updatedBy')" />
|
||||
<el-table-column prop="updatedTime" label="修改时间" :show-overflow-tooltip="true" v-if="columns.showColumn('updatedTime')" />
|
||||
<el-table-column label="操作" width="160">
|
||||
<template #default="scope">
|
||||
<el-button type="warning" size="small" icon="edit" @click="handleUpdate(scope.row)">盘点</el-button>
|
||||
<!-- <el-button type="success" size="small" icon="edit" title="编辑" v-hasPermi="['business:mmslowmovematerial:edit']" @click="handleUpdate(scope.row)"></el-button>
|
||||
<el-button type="danger" size="small" icon="delete" title="删除" v-hasPermi="['business:mmslowmovematerial:delete']" @click="handleDelete(scope.row)"></el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改车间呆滞品盘点对话框 -->
|
||||
<el-dialog :title="title" :lock-scroll="false" v-model="open">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<!-- <el-col :lg="12">
|
||||
<el-form-item label="雪花" prop="id">
|
||||
<el-input v-model="form.id" placeholder="请输入雪花" :disabled="opertype != 1" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="产线code" prop="lineCode">
|
||||
<el-input v-model="form.lineCode" placeholder="请输入产线code" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
|
||||
<!-- <el-col :lg="12">
|
||||
<el-form-item label="物料编号" prop="materialCode">
|
||||
<el-input v-model="form.materialCode" placeholder="请输入物料编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="物料名称" prop="materialName">
|
||||
<el-input v-model="form.materialName" placeholder="请输入物料名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="规格" prop="specification">
|
||||
<el-input v-model="form.specification" placeholder="请输入规格" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="理论呆滞数量" prop="logicQuantity">
|
||||
<el-input v-model="form.logicQuantity" readonly placeholder="请输入理论呆滞数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="实际盘点数量" prop="actualQuantity">
|
||||
<el-input-number v-model="form.actualQuantity" placeholder="请输入实际盘点数量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :lg="12">
|
||||
<el-form-item label="盘点时间" prop="checkDate">
|
||||
<el-date-picker v-model="form.checkDate" type="datetime" :teleported="false" placeholder="选择盘点时间"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer v-if="opertype != 3">
|
||||
<el-button text @click="cancel">{{ $t('btn.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="submitForm">{{ $t('btn.submit') }}</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 生成数据 -->
|
||||
<ZrDialog width="500" v-model="generateShow" append-to-body draggable :close-on-click-modal="false">
|
||||
<el-form label-width="100px" v-loading="syncLoading">
|
||||
<el-form-item label="生成日期" prop="generateTime">
|
||||
<el-date-picker v-model="generateTime" type="date" :clearable="false" :teleported="false" placeholder="选择日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button text @click="generateShow = false">{{ $t('btn.cancel') }}</el-button>
|
||||
<el-button type="primary" :disabled="syncLoading" @click="generateShopMoveSlowMaterial">{{ $t('btn.submit') }}</el-button>
|
||||
</template>
|
||||
</ZrDialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="mmslowmovematerial">
|
||||
import {
|
||||
generate_shop_moveSlow_material,
|
||||
listMmSlowMoveMaterial,
|
||||
addMmSlowMoveMaterial,
|
||||
delMmSlowMoveMaterial,
|
||||
updateMmSlowMoveMaterial,
|
||||
getMmSlowMoveMaterial
|
||||
} from '@/api/materialManagement/mmslowmovematerial.js'
|
||||
const { proxy } = getCurrentInstance()
|
||||
const ids = ref([])
|
||||
const loading = ref(false)
|
||||
const showSearch = ref(true)
|
||||
const queryParams = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
lineCode: '1',
|
||||
checkDateArray: [proxy.dayjs().toDate(), proxy.dayjs().toDate()],
|
||||
sort: 'warehouseDeliveryConsume',
|
||||
sortType: 'desc'
|
||||
})
|
||||
const columns = ref([
|
||||
{ visible: false, prop: 'id', label: '雪花' },
|
||||
{ visible: true, prop: 'lineCode', label: '产线code' },
|
||||
{ visible: true, prop: 'checkDate', label: '检查日期' },
|
||||
{ visible: true, prop: 'materialCode', label: '物料code' },
|
||||
{ visible: true, prop: 'materialName', label: '物料名称' },
|
||||
{ visible: true, prop: 'specification', label: '规格' },
|
||||
{ visible: true, prop: 'reportConsume', label: '报工消耗量' },
|
||||
{ visible: true, prop: 'warehouseDeliveryConsume', label: '仓库发货消耗量' },
|
||||
{ visible: true, prop: 'logicQuantity', label: '理论呆滞数量' },
|
||||
{ visible: true, prop: 'actualQuantity', label: '实际盘点数量' },
|
||||
{ visible: false, prop: 'unit', label: '单位' },
|
||||
{ visible: false, prop: 'createdBy', label: '创建人' },
|
||||
{ visible: false, prop: 'createdTime', label: '创建时间' },
|
||||
{ visible: false, prop: 'updatedBy', label: '修改人' },
|
||||
{ visible: false, prop: 'updatedTime', label: '修改时间' }
|
||||
])
|
||||
const total = ref(0)
|
||||
const dataList = ref([])
|
||||
const queryRef = ref()
|
||||
const defaultTime = ref([new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)])
|
||||
|
||||
var dictParams = []
|
||||
|
||||
/// =========================== 生成数据 ===========================
|
||||
const syncLoading = ref(false)
|
||||
const generateShow = ref(false)
|
||||
function generateDialogShow() {
|
||||
generateShow.value = true
|
||||
}
|
||||
const generateTime = ref(proxy.dayjs().toDate())
|
||||
function generateShopMoveSlowMaterial() {
|
||||
syncLoading.value = true
|
||||
const params = {
|
||||
selecDate: generateTime.value
|
||||
}
|
||||
generate_shop_moveSlow_material(params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$message.success('生成成功')
|
||||
getList()
|
||||
syncLoading.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
/// ==========================================================
|
||||
|
||||
// =========== 获取所有线别 ==========
|
||||
import { GetAllRoute } from '@/api/productManagement/proworkorder.js'
|
||||
const allRouteOptions = ref([])
|
||||
function getAllRouteOptions() {
|
||||
GetAllRoute().then((res) => {
|
||||
if (res.code === 200) {
|
||||
allRouteOptions.value = res.data.map((item) => {
|
||||
return {
|
||||
id: item.id,
|
||||
label: `${item.code}-${item.name}`,
|
||||
value: `${item.code}`
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
getAllRouteOptions()
|
||||
// ==================================
|
||||
|
||||
function getList() {
|
||||
loading.value = true
|
||||
listMmSlowMoveMaterial(queryParams).then((res) => {
|
||||
const { code, data } = res
|
||||
if (code == 200) {
|
||||
dataList.value = data.result
|
||||
total.value = data.totalNum
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 查询
|
||||
function handleQuery() {
|
||||
queryParams.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
// 重置查询操作
|
||||
function resetQuery() {
|
||||
proxy.resetForm('queryRef')
|
||||
handleQuery()
|
||||
}
|
||||
// 自定义排序
|
||||
function sortChange(column) {
|
||||
var sort = undefined
|
||||
var sortType = undefined
|
||||
|
||||
if (column.prop != null && column.order != null) {
|
||||
sort = column.prop
|
||||
sortType = column.order
|
||||
}
|
||||
queryParams.sort = sort
|
||||
queryParams.sortType = sortType
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/*************** form操作 ***************/
|
||||
const formRef = ref()
|
||||
const title = ref('')
|
||||
// 操作类型 1、add 2、edit 3、view
|
||||
const opertype = ref(0)
|
||||
const open = ref(false)
|
||||
const state = reactive({
|
||||
single: true,
|
||||
multiple: true,
|
||||
form: {},
|
||||
rules: {
|
||||
id: [{ required: true, message: '雪花不能为空', trigger: 'blur' }]
|
||||
},
|
||||
options: {}
|
||||
})
|
||||
|
||||
const { form, rules, options, single, multiple } = toRefs(state)
|
||||
|
||||
// 关闭dialog
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
}
|
||||
|
||||
// 重置表单
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
lineCode: null,
|
||||
checkDate: null,
|
||||
materialCode: null,
|
||||
materialName: null,
|
||||
specification: null,
|
||||
logicQuantity: null,
|
||||
actualQuantity: null,
|
||||
unit: null,
|
||||
createdBy: null,
|
||||
createdTime: null,
|
||||
updatedBy: null,
|
||||
updatedTime: null
|
||||
}
|
||||
proxy.resetForm('formRef')
|
||||
}
|
||||
// 添加按钮操作
|
||||
function handleAdd() {
|
||||
reset()
|
||||
open.value = true
|
||||
title.value = '添加车间呆滞品盘点'
|
||||
opertype.value = 1
|
||||
}
|
||||
// 修改按钮操作
|
||||
function handleUpdate(row) {
|
||||
reset()
|
||||
const id = row.id || ids.value
|
||||
getMmSlowMoveMaterial(id).then((res) => {
|
||||
const { code, data } = res
|
||||
if (code == 200) {
|
||||
open.value = true
|
||||
title.value = '修改车间呆滞品盘点'
|
||||
opertype.value = 2
|
||||
|
||||
form.value = {
|
||||
...data
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 添加&修改 表单提交
|
||||
function submitForm() {
|
||||
proxy.$refs['formRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.id != undefined && opertype.value === 2) {
|
||||
form.value.checkDate = proxy.dayjs().toDate()
|
||||
updateMmSlowMoveMaterial(form.value).then((res) => {
|
||||
proxy.$modal.msgSuccess('修改成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addMmSlowMoveMaterial(form.value).then((res) => {
|
||||
proxy.$modal.msgSuccess('新增成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除按钮操作
|
||||
function handleDelete(row) {
|
||||
const Ids = row.id || ids.value
|
||||
|
||||
proxy
|
||||
.$confirm('是否确认删除参数编号为"' + Ids + '"的数据项?')
|
||||
.then(function () {
|
||||
return delMmSlowMoveMaterial(Ids)
|
||||
})
|
||||
.then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess('删除成功')
|
||||
})
|
||||
}
|
||||
|
||||
handleQuery()
|
||||
</script>
|
||||
Loading…
x
Reference in New Issue
Block a user