fix:配方管理修改
This commit is contained in:
parent
16d41e42b8
commit
6c74eaffee
@ -6,7 +6,7 @@ import request from '@/utils/request'
|
||||
*/
|
||||
export function listBaseMaterialBom(query) {
|
||||
return request({
|
||||
url: 'mes/baseManagement/BaseMaterialBOM/list',
|
||||
url: 'MasterDataManagement/Material/MaterialBom/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
@ -18,7 +18,7 @@ export function listBaseMaterialBom(query) {
|
||||
*/
|
||||
export function GetMonterInvList(query) {
|
||||
return request({
|
||||
url: 'mes/baseManagement/BaseMaterialBOM/get_monter_inv',
|
||||
url: 'MasterDataManagement/Material/MaterialBom/get_monter_inv',
|
||||
method: 'post',
|
||||
data: query,
|
||||
})
|
||||
@ -30,7 +30,7 @@ export function GetMonterInvList(query) {
|
||||
*/
|
||||
export function GetSonInvList(query) {
|
||||
return request({
|
||||
url: 'mes/baseManagement/BaseMaterialBOM/get_son_inv',
|
||||
url: 'MasterDataManagement/Material/MaterialBom/get_son_inv',
|
||||
method: 'post',
|
||||
data: query,
|
||||
})
|
||||
@ -42,7 +42,7 @@ export function GetSonInvList(query) {
|
||||
*/
|
||||
export function addBaseMaterialBom(data) {
|
||||
return request({
|
||||
url: 'mes/baseManagement/BaseMaterialBOM',
|
||||
url: 'MasterDataManagement/Material/MaterialBom',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
@ -53,7 +53,7 @@ export function addBaseMaterialBom(data) {
|
||||
*/
|
||||
export function updateBaseMaterialBom(data) {
|
||||
return request({
|
||||
url: 'mes/baseManagement/BaseMaterialBOM',
|
||||
url: 'MasterDataManagement/Material/MaterialBom',
|
||||
method: 'PUT',
|
||||
data: data,
|
||||
})
|
||||
@ -64,7 +64,7 @@ export function updateBaseMaterialBom(data) {
|
||||
*/
|
||||
export function getBaseMaterialBom(id) {
|
||||
return request({
|
||||
url: 'mes/baseManagement/BaseMaterialBOM/' + id,
|
||||
url: 'MasterDataManagement/Material/MaterialBom/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@ -75,7 +75,7 @@ export function getBaseMaterialBom(id) {
|
||||
*/
|
||||
export function delBaseMaterialBom(pid) {
|
||||
return request({
|
||||
url: 'mes/baseManagement/BaseMaterialBOM/' + pid,
|
||||
url: 'MasterDataManagement/Material/MaterialBom/' + pid,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -2,7 +2,7 @@ import request from '@/utils/request'
|
||||
//左侧树
|
||||
export function getData(data) {
|
||||
return request({
|
||||
url: '/mes/PfRefProductRecipe/list',
|
||||
url: '/MasterDataManagement/Recipe//PfRefProductRecipe/list',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
@ -10,7 +10,7 @@ export function getData(data) {
|
||||
//查询卡片
|
||||
export function getCardData(data) {
|
||||
return request({
|
||||
url: '/mes/PfRecipeVersion/list',
|
||||
url: '/MasterDataManagement/Recipe//PfRecipeVersion/list',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
@ -19,7 +19,7 @@ export function getCardData(data) {
|
||||
//修改
|
||||
export function updateData(data) {
|
||||
return request({
|
||||
url: '/mes/PfRecipeVersion',
|
||||
url: '/MasterDataManagement/Recipe//PfRecipeVersion',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
@ -28,7 +28,7 @@ export function updateData(data) {
|
||||
|
||||
export function listPfRecipeParameters(query) {
|
||||
return request({
|
||||
url: 'mes/PfRecipeParameters/list',
|
||||
url: 'MasterDataManagement/Recipe//PfRecipeParameters/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
@ -40,7 +40,7 @@ export function listPfRecipeParameters(query) {
|
||||
*/
|
||||
export function addPfRecipeParameters(data) {
|
||||
return request({
|
||||
url: 'mes/PfRecipeParameters',
|
||||
url: 'MasterDataManagement/Recipe//PfRecipeParameters',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
@ -51,7 +51,7 @@ export function addPfRecipeParameters(data) {
|
||||
*/
|
||||
export function updatePfRecipeParameters(data) {
|
||||
return request({
|
||||
url: 'mes/PfRecipeParameters',
|
||||
url: 'MasterDataManagement/Recipe//PfRecipeParameters',
|
||||
method: 'PUT',
|
||||
data: data,
|
||||
})
|
||||
@ -62,7 +62,7 @@ export function updatePfRecipeParameters(data) {
|
||||
*/
|
||||
export function getPfRecipeParameters(id) {
|
||||
return request({
|
||||
url: 'mes/PfRecipeParameters/' + id,
|
||||
url: 'MasterDataManagement/Recipe//PfRecipeParameters/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@ -73,7 +73,7 @@ export function getPfRecipeParameters(id) {
|
||||
*/
|
||||
export function delPfRecipeParameters(pid) {
|
||||
return request({
|
||||
url: 'mes/PfRecipeParameters/delete/' + pid,
|
||||
url: 'MasterDataManagement/Recipe//PfRecipeParameters/delete/' + pid,
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
@ -82,7 +82,7 @@ export function delPfRecipeParameters(pid) {
|
||||
//新增
|
||||
export function addData(data) {
|
||||
return request({
|
||||
url: '/mes/PfRecipeVersion/latestVersion',
|
||||
url: '/MasterDataManagement/Recipe//PfRecipeVersion/latestVersion',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
@ -91,7 +91,7 @@ export function addData(data) {
|
||||
//外层新增
|
||||
export function addOutData(data) {
|
||||
return request({
|
||||
url: '/mes/PfRecipeVersion/createPfRecipeVersionAndParameters',
|
||||
url: '/MasterDataManagement/Recipe//PfRecipeVersion/createPfRecipeVersionAndParameters',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@ -100,7 +100,7 @@ export function addOutData(data) {
|
||||
//配方码下拉
|
||||
export function getRecipeCode(data) {
|
||||
return request({
|
||||
url: '/mes/PfRefProductRecipe/getRecipeCodePullDown',
|
||||
url: '/MasterDataManagement/Recipe//PfRefProductRecipe/getRecipeCodePullDown',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
@ -109,7 +109,7 @@ export function getRecipeCode(data) {
|
||||
//内层新增
|
||||
export function addInData(data) {
|
||||
return request({
|
||||
url: '/mes/PfRecipeParameters',
|
||||
url: '/MasterDataManagement/Recipe//PfRecipeParameters',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@ -118,7 +118,7 @@ export function addInData(data) {
|
||||
//内层修改
|
||||
export function updateInData(data) {
|
||||
return request({
|
||||
url: '/mes/PfRecipeParameters',
|
||||
url: '/MasterDataManagement/Recipe//PfRecipeParameters',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
@ -127,7 +127,7 @@ export function updateInData(data) {
|
||||
//下达
|
||||
export function releaseData(data) {
|
||||
return request({
|
||||
url: '/mes/PfRecipeIssueLog/issueRecipe',
|
||||
url: '/MasterDataManagement/Recipe//PfRecipeIssueLog/issueRecipe',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@ -136,7 +136,7 @@ export function releaseData(data) {
|
||||
//内层删除
|
||||
export function delInData(id) {
|
||||
return request({
|
||||
url: '/mes/PfRecipeParameters/delete/' + id,
|
||||
url: '/MasterDataManagement/Recipe//PfRecipeParameters/delete/' + id,
|
||||
method: 'post',
|
||||
})
|
||||
}
|
||||
@ -2,7 +2,7 @@ import request from '@/utils/request'
|
||||
//查询
|
||||
export function getData(data) {
|
||||
return request({
|
||||
url: '/mes/PfRefProductRecipe/list',
|
||||
url: '/MasterDataManagement/Recipe//PfRefProductRecipe/list',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
@ -10,7 +10,7 @@ export function getData(data) {
|
||||
//新增
|
||||
export function addData(data) {
|
||||
return request({
|
||||
url: '/mes/PfRefProductRecipe',
|
||||
url: '/MasterDataManagement/Recipe//PfRefProductRecipe',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
@ -19,7 +19,7 @@ export function addData(data) {
|
||||
//修改
|
||||
export function updateData(data) {
|
||||
return request({
|
||||
url: '/mes/PfRefProductRecipe',
|
||||
url: '/MasterDataManagement/Recipe//PfRefProductRecipe',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
@ -27,7 +27,7 @@ export function updateData(data) {
|
||||
//删除
|
||||
export function deleteData(id) {
|
||||
return request({
|
||||
url: '/mes/PfRefProductRecipe/delete/' + id,
|
||||
url: '/MasterDataManagement/Recipe//PfRefProductRecipe/delete/' + id,
|
||||
method: 'post',
|
||||
|
||||
})
|
||||
|
||||
@ -6,7 +6,7 @@ import request from '@/utils/request'
|
||||
*/
|
||||
export function listPfRecipeIssueLog(query) {
|
||||
return request({
|
||||
url: 'mes/PfRecipeIssueLog/list',
|
||||
url: 'MasterDataManagement/Recipe//PfRecipeIssueLog/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
@ -18,7 +18,7 @@ export function listPfRecipeIssueLog(query) {
|
||||
*/
|
||||
export function addPfRecipeIssueLog(data) {
|
||||
return request({
|
||||
url: 'mes/PfRecipeIssueLog',
|
||||
url: 'MasterDataManagement/Recipe//PfRecipeIssueLog',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
@ -29,7 +29,7 @@ export function addPfRecipeIssueLog(data) {
|
||||
*/
|
||||
export function updatePfRecipeIssueLog(data) {
|
||||
return request({
|
||||
url: 'mes/PfRecipeIssueLog',
|
||||
url: 'MasterDataManagement/Recipe//PfRecipeIssueLog',
|
||||
method: 'PUT',
|
||||
data: data,
|
||||
})
|
||||
@ -40,7 +40,7 @@ export function updatePfRecipeIssueLog(data) {
|
||||
*/
|
||||
export function getPfRecipeIssueLog(id) {
|
||||
return request({
|
||||
url: 'mes/PfRecipeIssueLog/' + id,
|
||||
url: 'MasterDataManagement/Recipe//PfRecipeIssueLog/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@ -51,7 +51,7 @@ export function getPfRecipeIssueLog(id) {
|
||||
*/
|
||||
export function delPfRecipeIssueLog(pid) {
|
||||
return request({
|
||||
url: 'mes/PfRecipeIssueLog/delete/' + pid,
|
||||
url: 'MasterDataManagement/Recipe//PfRecipeIssueLog/delete/' + pid,
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
|
||||
@ -64,19 +64,19 @@ export const constantRoutes = [
|
||||
component: () => import('@/views/error/Error'),
|
||||
hidden: true
|
||||
},
|
||||
// {
|
||||
// path: '',
|
||||
// component: Layout,
|
||||
// redirect: '/index',
|
||||
// children: [
|
||||
// {
|
||||
// path: '/index',
|
||||
// component: () => import('@/views/index'),
|
||||
// name: 'Index',
|
||||
// meta: { title: '首页', icon: 'index', affix: true, titleKey: 'menu.home' }
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
path: '',
|
||||
component: Layout,
|
||||
redirect: '/index',
|
||||
children: [
|
||||
{
|
||||
path: '/index',
|
||||
component: () => import('@/views/masterDataManagement/Plant/PlantFactorySite'),
|
||||
name: 'Index',
|
||||
meta: { title: '首页', icon: 'index', affix: true, titleKey: 'menu.home' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/user',
|
||||
component: Layout,
|
||||
|
||||
@ -439,10 +439,11 @@ const formRules = ref({
|
||||
version: [{ required: true, message: '请输入版本号', trigger: 'blur' }],
|
||||
})
|
||||
const handleVersionChange = (val) => {
|
||||
console.log(val, '输入的版本号');
|
||||
// dataList.value.forEach(row => {
|
||||
// row.version = val
|
||||
// })
|
||||
console.log(val, '输入的版本号');
|
||||
// 将所有表格行的版本号都更新为新输入的版本号
|
||||
dataList.value.forEach(row => {
|
||||
row.version = val
|
||||
})
|
||||
}
|
||||
const handleXiaDaSubmit = () => {
|
||||
let data = {
|
||||
@ -502,8 +503,11 @@ const handleQuery = () => {
|
||||
})
|
||||
})
|
||||
selectShow.value = true
|
||||
dataList.value = res.data
|
||||
|
||||
// dataList.value = res.data
|
||||
dataList.value = res.data.map(item => ({
|
||||
...item,
|
||||
version: formAdd.value.version // 将用户输入的新版本号赋给每行数据
|
||||
}))
|
||||
originalDataList.value = JSON.parse(JSON.stringify(res.data || []))
|
||||
}
|
||||
})
|
||||
|
||||
@ -102,6 +102,9 @@
|
||||
<script setup name="baseworkstation">
|
||||
import { getData, addData, updateData, deleteData } from "@/api/humanComputerInteraction/productFormula/index.js"
|
||||
import { getOneDict } from '@/utils/dict.js'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
const userStore = useUserStore()
|
||||
const userName = userStore.userName
|
||||
const { proxy } = getCurrentInstance()
|
||||
const ids = ref([])
|
||||
const loading = ref(false)
|
||||
@ -234,19 +237,33 @@ function handleUpdate(row) {
|
||||
...row
|
||||
}
|
||||
}
|
||||
|
||||
function formatDateTime(date) {
|
||||
const year = date.getFullYear()
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(date.getDate()).padStart(2, '0')
|
||||
const hours = String(date.getHours()).padStart(2, '0')
|
||||
const minutes = String(date.getMinutes()).padStart(2, '0')
|
||||
const seconds = String(date.getSeconds()).padStart(2, '0')
|
||||
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
|
||||
}
|
||||
// 添加&修改 表单提交
|
||||
function submitForm() {
|
||||
proxy.$refs['formRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
let data={
|
||||
...form.value,
|
||||
CreatedBy: userName,
|
||||
createTime: formatDateTime(new Date()),
|
||||
}
|
||||
if (form.value.id != undefined && opertype.value === 2) {
|
||||
updateData(form.value).then((res) => {
|
||||
updateData(data).then((res) => {
|
||||
proxy.$modal.msgSuccess('修改成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
} else {
|
||||
addData(form.value).then((res) => {
|
||||
addData(data).then((res) => {
|
||||
proxy.$modal.msgSuccess('新增成功')
|
||||
open.value = false
|
||||
getList()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user