新增物料台账下拉
This commit is contained in:
parent
9f592b63e6
commit
45a0cb48e4
@ -55,3 +55,10 @@ export function delBaseMaterialList(pid) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
//类别下拉
|
||||
export function GetMaterialTypeList() {
|
||||
return request({
|
||||
url: 'MasterDataManagement/Material/MaterialList/getMaterialTypePullDown',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@ -221,3 +221,27 @@ export function GetWorkorderTraceProgressList(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
//下发工单
|
||||
export function IssueWorkorder(workorder) {
|
||||
return request({
|
||||
url: `mes/productManagement/ProWorkorder/start_workorder?workorder=${workorder}`,
|
||||
method: 'get',
|
||||
// params: data
|
||||
})
|
||||
}
|
||||
//暂停工单
|
||||
export function PauseWorkorder(workorder) {
|
||||
return request({
|
||||
url: `mes/productManagement/ProWorkorder/pause_workorder?workorder=${workorder}`,
|
||||
method: 'get',
|
||||
|
||||
})
|
||||
}
|
||||
//结束工单
|
||||
export function EndWorkorder(workorder) {
|
||||
return request({
|
||||
url: `mes/productManagement/ProWorkorder/finish_workorder?workorder=${workorder}`,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
@ -16,9 +16,12 @@
|
||||
<el-row :gutter="15" class="mb10">
|
||||
<el-col :span="1.5">
|
||||
<el-col :span="1.5">
|
||||
<el-button class="tool-box" type="primary" icon="Plus" @click="handleAdd"> 新增 </el-button>
|
||||
<el-button class="tool-box" color="#626aef" icon="Download" @click="handleImport"> 导入
|
||||
</el-button>
|
||||
<el-button class="tool-box" color="#00aa00" icon="Upload" @click="handleDownload"> 导出 </el-button>
|
||||
<el-button type="danger" icon="delete" @click="handleBatchDelete"
|
||||
:disabled="ids.length === 0">批量删除</el-button>
|
||||
</el-col>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -28,22 +31,37 @@
|
||||
loadMethod: loadContentMethod,
|
||||
iconOpen: 'vxe-icon-square-minus-fill',
|
||||
iconClose: 'vxe-icon-square-plus-fill'
|
||||
}" :data="dataList">
|
||||
}" :data="dataList" @checkbox-change="handleSelectionChange" @checkbox-all="handleSelectAll">
|
||||
<vxe-column type="checkbox" width="60" fixed="left"></vxe-column>
|
||||
<vxe-column type="seq" width="60"></vxe-column>
|
||||
<vxe-column type="expand" width="80">
|
||||
<template #content="{ row }">
|
||||
<vxe-table border size="mini" stripe :data="row.children">
|
||||
<vxe-table border size="mini" stripe :data="row.children" @checkbox-change="handleSelectionChange2"
|
||||
@checkbox-all="handleSelectAll2">
|
||||
<vxe-column type="checkbox" width="60" fixed="left"></vxe-column>
|
||||
<vxe-column type="seq" width="60"></vxe-column>
|
||||
<vxe-column field="subInvCode" title="子件编码"></vxe-column>
|
||||
<vxe-column field="subInvName" title="子件名称"></vxe-column>
|
||||
<vxe-column field="iusequantity" title="使用数量"></vxe-column>
|
||||
<vxe-column field="bomVersion" title="bom版本"></vxe-column>
|
||||
<vxe-column field="iusequantity" title="操作">
|
||||
<template #default="{ row }">
|
||||
<!-- <el-button type="success" size="small" icon="edit" title="编辑" @click="handleEdit(row)"></el-button>
|
||||
<el-button type="danger" @click="handleDelete(row)" size="small" icon="delete" title="删除" /> -->
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="invCode" title="母件编码"></vxe-column>
|
||||
<vxe-column field="invName" title="母件名称"></vxe-column>
|
||||
<vxe-column field="bomVersion" title="bom版本"></vxe-column>
|
||||
<vxe-column field="iusequantity" title="操作">
|
||||
<template #default="{ row }">
|
||||
<el-button type="success" size="small" icon="edit" title="编辑" @click="handleEdit(row)"></el-button>
|
||||
<el-button type="danger" size="small" icon="delete" title="删除" @click="handleDelete(row)"></el-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
@ -98,6 +116,7 @@ const columns = ref([
|
||||
])
|
||||
const total = ref(0)
|
||||
const dataList = ref([])
|
||||
const tableRef = ref() // 添加表格引用
|
||||
const queryRef = ref()
|
||||
const defaultTime = ref([new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)])
|
||||
|
||||
@ -114,6 +133,83 @@ function getList() {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 获取选中的行数据
|
||||
function getSelectedRows() {
|
||||
if (tableRef.value) {
|
||||
const selectedRows = tableRef.value.getCheckboxRecords()
|
||||
console.log('选中的行数据:', selectedRows)
|
||||
return selectedRows
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
// 处理单个复选框选中状态变化
|
||||
function handleSelectionChange() {
|
||||
const selectedRows = tableRef.value.getCheckboxRecords()
|
||||
ids.value = selectedRows.map(row => row.id) // 假设有id字段
|
||||
console.log('当前选中项ID:', ids.value)
|
||||
}
|
||||
|
||||
// 处理全选/取消全选
|
||||
function handleSelectAll({ records }) {
|
||||
ids.value = records.map(row => row.id) // 假设有id字段
|
||||
console.log('全选/取消全选后ID:', ids.value)
|
||||
}
|
||||
|
||||
// 批量编辑
|
||||
function handleBatchEdit() {
|
||||
const selectedRows = getSelectedRows()
|
||||
if (selectedRows.length === 0) {
|
||||
proxy.$modal.msgWarning('请选择要编辑的数据')
|
||||
return
|
||||
}
|
||||
console.log('批量编辑数据:', selectedRows)
|
||||
// 这里实现批量编辑逻辑
|
||||
}
|
||||
|
||||
// 批量删除
|
||||
function handleBatchDelete() {
|
||||
const selectedRows = getSelectedRows()
|
||||
if (selectedRows.length === 0) {
|
||||
proxy.$modal.msgWarning('请选择要删除的数据')
|
||||
return
|
||||
}
|
||||
|
||||
proxy.$modal.confirm(`确认删除已选中的 ${selectedRows.length} 条数据?`)
|
||||
.then(() => {
|
||||
// 这里实现批量删除逻辑
|
||||
console.log('批量删除数据:', selectedRows)
|
||||
// 示例API调用
|
||||
// return deleteBatch(ids.value)
|
||||
})
|
||||
.then(() => {
|
||||
proxy.$modal.msgSuccess('删除成功')
|
||||
getList()
|
||||
})
|
||||
}
|
||||
|
||||
//修改
|
||||
function handleEdit(row) {
|
||||
console.log('编辑行数据:', row)
|
||||
// 实现编辑逻辑
|
||||
}
|
||||
|
||||
// 删除单行
|
||||
function handleDelete(row) {
|
||||
proxy.$modal.confirm('确认删除该条数据?')
|
||||
.then(() => {
|
||||
// 实现删除逻辑
|
||||
console.log('删除行数据:', row.id)
|
||||
// 示例API调用
|
||||
// return deleteById(row.id)
|
||||
})
|
||||
.then(() => {
|
||||
proxy.$modal.msgSuccess('删除成功')
|
||||
getList()
|
||||
})
|
||||
}
|
||||
|
||||
// 子数据懒加载
|
||||
function loadContentMethod({ row }) {
|
||||
return new Promise((resolve) => {
|
||||
@ -165,7 +261,7 @@ function importTemplate() {
|
||||
}
|
||||
/** 文件上传异常处理 */
|
||||
const handleFileError = (error, file, fileList) => {
|
||||
const { code, msg, data } = response
|
||||
// 修复:使用正确的响应对象
|
||||
if (error) {
|
||||
proxy.$message.error('模板导入异常!')
|
||||
return
|
||||
@ -264,4 +360,4 @@ function handleSync() {
|
||||
/// =================================================================
|
||||
|
||||
handleQuery()
|
||||
</script>
|
||||
</script>
|
||||
@ -98,15 +98,19 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="类别编号" prop="fkMaterialTypeCode">
|
||||
<el-input v-model.trim="form.fkMaterialTypeCode" placeholder="请输入类别编号" />
|
||||
<!-- <el-input v-model.trim="form.fkMaterialTypeCode" placeholder="请输入类别编号" /> -->
|
||||
<el-select v-model="form.fkMaterialTypeCode" placeholder="请选择类别编号" style="width: 100%">
|
||||
<el-option v-for="item in typeList" :key="item.value" :label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<!-- <el-col :lg="12">
|
||||
<el-form-item label="类别名称" prop="fkMaterialTypeName">
|
||||
<el-input v-model.trim="form.fkMaterialTypeName" placeholder="请输入类别名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="物料编码" prop="code">
|
||||
@ -151,7 +155,8 @@ import {
|
||||
addBaseMaterialList,
|
||||
delBaseMaterialList,
|
||||
updateBaseMaterialList,
|
||||
getBaseMaterialList
|
||||
getBaseMaterialList,
|
||||
GetMaterialTypeList
|
||||
} from '@/api/baseManagement/basemateriallist.js'
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
@ -161,6 +166,7 @@ const showSearch = ref(true)
|
||||
const dialogVisibleActualAssembly = ref(false)
|
||||
const formRef = ref(null)
|
||||
const title = ref("")
|
||||
const typeList=ref([])
|
||||
const queryParams = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
@ -213,6 +219,18 @@ function handleImport(type) {
|
||||
upload.title = '导入'
|
||||
upload.open = true
|
||||
}
|
||||
function GetMaterialTypeListData() {
|
||||
GetMaterialTypeList().then((res) => {
|
||||
if (res.code == 200) {
|
||||
typeList.value = res.data.map(item => {
|
||||
return{
|
||||
value: item.value,
|
||||
label: item.label
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
//导出
|
||||
function handleDownload() {
|
||||
proxy
|
||||
@ -370,10 +388,12 @@ const handleAdd = () => {
|
||||
open.value = true
|
||||
title.value = '添加'
|
||||
opertype.value = 1
|
||||
GetMaterialTypeListData()
|
||||
}
|
||||
const handleEdit=(row)=>{
|
||||
open.value = true
|
||||
title.value = '修改'
|
||||
GetMaterialTypeListData()
|
||||
opertype.value = 2
|
||||
getBaseMaterialList(row.id).then((res) => {
|
||||
form.value = {
|
||||
|
||||
@ -39,8 +39,10 @@
|
||||
v-if="columns.showColumn('fkOperationCode')" />
|
||||
<el-table-column prop="fkProductlinebodyCode" label="产线" align="center" :show-overflow-tooltip="true"
|
||||
v-if="columns.showColumn('fkProductlinebodyCode')" />
|
||||
<el-table-column prop="fkWorkstationCode" label="工位" align="center" :show-overflow-tooltip="true"
|
||||
v-if="columns.showColumn('fkWorkstationCode')" />
|
||||
<el-table-column prop="workstationName" label="工站" align="center" :show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column prop="workstationCode" label="工站编号" align="center" :show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column prop="isActive" label="是否有效" align="center" v-if="columns.showColumn('isActive')">
|
||||
<template #default="scope">
|
||||
<el-tag type="success" v-if="scope.row.isActive == 'True'">有效</el-tag>
|
||||
@ -115,15 +117,15 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="工位" prop="fkWorkstationCode">
|
||||
<el-select v-model="form.fkWorkstationCode" placeholder="请选择" style="width: 100%">
|
||||
<el-option v-for="item in workstationNameSelect" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-form-item label="工站" prop="workstationName">
|
||||
<el-input v-model="form.workstationName" placeholder="请输入工站" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item label="工站编号" prop="workstationCode">
|
||||
<el-input v-model="form.workstationCode" placeholder="请输入工站编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- <el-col :lg="12">
|
||||
<el-form-item label="工序编码" prop="fkOperationCode">
|
||||
<el-input v-model="form.fkOperationCode" placeholder="请输入工序编码" />
|
||||
|
||||
@ -77,17 +77,40 @@
|
||||
</el-table>
|
||||
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<el-dialog :lock-scroll="false" v-model="open" draggable :close-on-click-modal="false" @close="cancel">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="title" prop="workorder">
|
||||
<el-input v-model.trim="form.workorder" clearable placeholder="请输入" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="proworkorder">
|
||||
import { GetWorkorderTraceProgressList } from '@/api/productManagement/proworkorder.js'
|
||||
import {
|
||||
GetWorkorderTraceProgressList,
|
||||
IssueWorkorder,
|
||||
PauseWorkorder,
|
||||
EndWorkorder
|
||||
} from '@/api/productManagement/proworkorder.js'
|
||||
import { getOneDict } from '@/utils/dict.js'
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const loading = ref(false)
|
||||
const showSearch = ref(true)
|
||||
|
||||
const open = ref(false)
|
||||
const title = ref('')
|
||||
// 使用原生 JavaScript 替代 dayjs
|
||||
const getDefaultTime = () => {
|
||||
const now = new Date()
|
||||
@ -139,6 +162,46 @@ function getList() {
|
||||
})
|
||||
}
|
||||
|
||||
function handleView(row) {
|
||||
title.value = '下发'
|
||||
open.value = true
|
||||
}
|
||||
function handleUpdate(row) {
|
||||
title.value = '暂停'
|
||||
open.value = true
|
||||
}
|
||||
function handleDelete(row) {
|
||||
title.value = '完成'
|
||||
open.value = true
|
||||
}
|
||||
function cancel() {
|
||||
open.value = false
|
||||
form.value.workorder = null
|
||||
}
|
||||
function submitForm() {
|
||||
if (title.value == '下发') {
|
||||
IssueWorkorder(form.value.workorder).then((res) => {
|
||||
proxy.$modal.msgSuccess('下发成功')
|
||||
form.value.workorder = null
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else if (title.value == '暂停') {
|
||||
PauseWorkorder(form.value.workorder).then((res) => {
|
||||
proxy.$modal.msgSuccess('暂停成功')
|
||||
form.value.workorder = null
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else if (title.value == '完成') {
|
||||
EndWorkorder(form.value.workorder).then((res) => {
|
||||
proxy.$modal.msgSuccess('完成成功')
|
||||
form.value.workorder = null
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
// 查询
|
||||
function handleQuery() {
|
||||
queryParams.pageNum = 1
|
||||
@ -176,6 +239,7 @@ function tableCellClassName({ row, column, rowIndex, columnIndex }) {
|
||||
}
|
||||
|
||||
const state = reactive({
|
||||
form: {},
|
||||
options: {
|
||||
// 优先级
|
||||
priorityOptions: [
|
||||
@ -191,7 +255,7 @@ const state = reactive({
|
||||
stationList: []
|
||||
})
|
||||
|
||||
const { options } = toRefs(state)
|
||||
const { options, form } = toRefs(state)
|
||||
|
||||
async function initDict() {
|
||||
const dictSelectList = ['pro_workorder_type', 'base_work_type']
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user