更新 #454
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2025-11-17 09:25:12
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-19 13:11:54
|
||||
* @LastEditTime: 2025-11-28 09:29:14
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
@@ -52,7 +52,15 @@ export function createProduct(data) {
|
||||
// 获得工艺分页
|
||||
export function getProcessPage(query) {
|
||||
return request({
|
||||
url: '/wms/process/page',
|
||||
url: '/wms/process/page/group/by',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 获得工艺点击展开表格
|
||||
export function getProcessDetailPage(query) {
|
||||
return request({
|
||||
url: '/wms/process/page/group/by/detail',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
@@ -64,6 +72,13 @@ export function deleteProcess(id) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
// 批量删除工艺
|
||||
export function deleteProcessList(ids) {
|
||||
return request({
|
||||
url: '/wms/process/delete-list?ids=' + ids,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
// 更新
|
||||
export function updateProcess(data) {
|
||||
return request({
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2022-08-24 11:19:43
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-19 13:20:30
|
||||
* @LastEditTime: 2025-11-28 09:35:03
|
||||
* @Description:
|
||||
*/
|
||||
export default {
|
||||
@@ -16,7 +16,7 @@ export default {
|
||||
},
|
||||
tableData: [], //table数据
|
||||
listQuery: { //分页
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
},
|
||||
|
||||
@@ -284,7 +284,7 @@ export default {
|
||||
mobile: '',
|
||||
mobileCode: '',
|
||||
rememberMe: false,
|
||||
tenantName: '技术中心',
|
||||
tenantName: '芋道源码',
|
||||
},
|
||||
scene: 21,
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-18 15:01:42
|
||||
* @LastEditTime: 2025-11-28 14:38:31
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -14,29 +14,29 @@
|
||||
label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品编码" prop="materialCode">
|
||||
<el-form-item label="物料编码" prop="materialCode">
|
||||
<el-input
|
||||
v-model="dataForm.materialCode"
|
||||
clearable
|
||||
placeholder="请输入产品编码" />
|
||||
placeholder="请输入物料编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品名称" prop="materialName">
|
||||
<el-form-item label="物料型号" prop="materialName">
|
||||
<el-input
|
||||
v-model="dataForm.materialName"
|
||||
clearable
|
||||
placeholder="请输入产品名称" />
|
||||
placeholder="请输入物料型号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品规格" prop="material">
|
||||
<el-form-item label="物料规格" prop="material">
|
||||
<el-input
|
||||
v-model="dataForm.material"
|
||||
clearable
|
||||
placeholder="请输入产品规格" />
|
||||
placeholder="请输入物料规格" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -65,10 +65,10 @@ export default {
|
||||
typeArr: [],
|
||||
dataRule: {
|
||||
materialCode: [
|
||||
{ required: true, message: '产品编码不能为空', trigger: 'blur' },
|
||||
{ required: true, message: '物料编码不能为空', trigger: 'blur' },
|
||||
],
|
||||
materialName: [
|
||||
{ required: true, message: '产品名称不能为空', trigger: 'blur' },
|
||||
{ required: true, message: '物料型号不能为空', trigger: 'blur' },
|
||||
],
|
||||
material: [
|
||||
{ required: true, message: '规格不能为空', trigger: 'blur' },
|
||||
|
||||
@@ -47,15 +47,15 @@ import { deleteProduct, getProductPage } from '@/api/ssdl/product&recipe';
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'materialCode',
|
||||
label: '产品编码',
|
||||
label: '物料编码',
|
||||
},
|
||||
{
|
||||
prop: 'materialName',
|
||||
label: '产品名称',
|
||||
label: '物料型号',
|
||||
},
|
||||
{
|
||||
prop: 'material',
|
||||
label: '规格型号',
|
||||
label: '规格',
|
||||
},
|
||||
{
|
||||
prop: 'creator',
|
||||
@@ -92,8 +92,8 @@ export default {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '名称',
|
||||
placeholder: '名称',
|
||||
label: '型号',
|
||||
placeholder: '型号',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
@@ -175,7 +175,7 @@ export default {
|
||||
},
|
||||
// 删除
|
||||
deleteHandle(id, name, index,data) {
|
||||
this.$confirm(`是否确认删除${'产品名称为 ' + data.materialName + ' '}的数据项?`, "系统提示", {
|
||||
this.$confirm(`是否确认删除${'物料型号为 ' + data.materialName + ' '}的数据项?`, "系统提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
|
||||
@@ -19,41 +19,25 @@
|
||||
label-position="top"
|
||||
@keyup.enter.native="dataFormSubmit">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="配方编码" prop="processCode">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="配方规格" prop="processSize">
|
||||
<el-input
|
||||
v-model="dataForm.processCode"
|
||||
v-model="dataForm.processSize"
|
||||
clearable
|
||||
:disabled="isdetail"
|
||||
placeholder="请输入配方编码" />
|
||||
placeholder="请输入配方规格" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="配方名称" prop="processName">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="配方型号" prop="processName">
|
||||
<el-input
|
||||
v-model="dataForm.processName"
|
||||
clearable
|
||||
:disabled="isdetail"
|
||||
placeholder="请输入配方名称" />
|
||||
placeholder="请输入配方型号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品" prop="materialId">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="dataForm.materialId"
|
||||
:disabled="isdetail"
|
||||
@change="setMaterial"
|
||||
placeholder="请选择产品">
|
||||
<el-option
|
||||
v-for="item in productArr"
|
||||
:key="item.id"
|
||||
:label="item.materialName"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="配方描述" prop="processDesc">
|
||||
<el-input
|
||||
v-model="dataForm.processDesc"
|
||||
@@ -68,16 +52,20 @@
|
||||
<small-title
|
||||
style="margin: 16px 0; padding-left: 8px"
|
||||
:no-padding="true"
|
||||
v-if="dataForm.id">
|
||||
产品属性列表
|
||||
v-if="dataForm.processName && dataForm.processSize">
|
||||
物料属性列表
|
||||
</small-title>
|
||||
|
||||
<div class="attr-list" v-if="dataForm.id">
|
||||
<div
|
||||
class="attr-list"
|
||||
v-if="dataForm.processName && dataForm.processSize">
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:add-button-show="isdetail ? null : '添加属性'"
|
||||
:add-button-show="
|
||||
productAttributeList.length > 3 || isdetail ? null : '添加属性'
|
||||
"
|
||||
@emitButtonClick="addNew()"
|
||||
:table-data="productAttributeList">
|
||||
<method-btn
|
||||
@@ -112,7 +100,6 @@
|
||||
<product-attr-add
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
:process-id="dataForm.id"
|
||||
@refreshDataList="getList" />
|
||||
</el-drawer>
|
||||
</template>
|
||||
@@ -122,9 +109,8 @@ import {
|
||||
updateProcess,
|
||||
createProcess,
|
||||
getProcess,
|
||||
getProcessMaterialPage,
|
||||
deleteProcessMaterial,
|
||||
getProductPage,
|
||||
getProcessDetailPage,
|
||||
deleteProcess,
|
||||
} from '@/api/ssdl/product&recipe';
|
||||
import productAttrAdd from './attr-add';
|
||||
import { parseTime } from '@/filter/code-filter';
|
||||
@@ -146,17 +132,17 @@ const tableProps = [
|
||||
label: '添加时间',
|
||||
filter: parseTime,
|
||||
},
|
||||
{
|
||||
prop: 'equipmentName',
|
||||
label: '设备名称',
|
||||
},
|
||||
{
|
||||
prop: 'materialName',
|
||||
label: '原料名称',
|
||||
label: '物料型号',
|
||||
},
|
||||
{
|
||||
prop: 'quantity',
|
||||
label: '数量',
|
||||
prop: 'material',
|
||||
label: '物料规格',
|
||||
},
|
||||
{
|
||||
prop: 'materialNumber',
|
||||
label: '物料数量',
|
||||
},
|
||||
];
|
||||
|
||||
@@ -171,41 +157,30 @@ export default {
|
||||
productAttributeList: [],
|
||||
dataForm: {
|
||||
id: null,
|
||||
processName: '', // 配方名称
|
||||
processCode: '', // 配方编码
|
||||
processName: '', // 配方型号
|
||||
processSize: '', // 配方规格
|
||||
processDesc: '', // 配方描述
|
||||
materialId: '', // 物料id
|
||||
materialName: '', // 物料名称
|
||||
materialCode: '', // 物料编码
|
||||
},
|
||||
productArr: [],
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 0,
|
||||
},
|
||||
dataRule: {
|
||||
processCode: [
|
||||
processSize: [
|
||||
{
|
||||
required: true,
|
||||
message: '配方编码不能为空',
|
||||
message: '配方规格不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
processName: [
|
||||
{
|
||||
required: true,
|
||||
message: '配方名称不能为空',
|
||||
message: '配方型号不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
materialId: [
|
||||
{
|
||||
required: true,
|
||||
message: '物料不能为空',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
},
|
||||
isdetail: false,
|
||||
};
|
||||
@@ -217,9 +192,6 @@ export default {
|
||||
},
|
||||
init(id, isdetail) {
|
||||
this.initData();
|
||||
getProductPage({ pageNo: 1, pageSize: 100 }).then((res) => {
|
||||
this.productArr = res.data.list;
|
||||
});
|
||||
this.isdetail = isdetail || false;
|
||||
this.dataForm.id = id || null;
|
||||
this.visible = true;
|
||||
@@ -228,31 +200,26 @@ export default {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
|
||||
if (this.dataForm.id) {
|
||||
// 获取产品详情
|
||||
// 获取物料详情
|
||||
getProcess(id).then((response) => {
|
||||
this.dataForm = response.data;
|
||||
// 获取物料的属性列表
|
||||
this.getList();
|
||||
});
|
||||
// 获取产品的属性列表
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
setMaterial() {
|
||||
const data = this.productArr.find(
|
||||
(i) => i.id === this.dataForm.materialId
|
||||
);
|
||||
this.dataForm.materialName = data.materialName;
|
||||
this.dataForm.materialCode = data.materialCode;
|
||||
},
|
||||
getList() {
|
||||
// 获取产品的属性列表
|
||||
getProcessMaterialPage({
|
||||
...this.listQuery,
|
||||
productId: this.dataForm.id,
|
||||
// 获取物料的属性列表
|
||||
getProcessDetailPage({
|
||||
processName: this.dataForm.processName,
|
||||
processSize: this.dataForm.processSize,
|
||||
pageSize: 100,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
}).then((response) => {
|
||||
this.productAttributeList = response.data.list;
|
||||
this.listQuery.total = response.data.total;
|
||||
this.productAttributeList = response.data;
|
||||
});
|
||||
},
|
||||
handleClick(raw) {
|
||||
@@ -271,7 +238,7 @@ export default {
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deleteProcessMaterial(raw.data.id).then(({ data }) => {
|
||||
deleteProcess(raw.data.id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
@@ -291,31 +258,30 @@ export default {
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
updateProcess(this.dataForm).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
if (
|
||||
!this.productAttributeList ||
|
||||
!(this.productAttributeList.length > 0)
|
||||
) {
|
||||
this.$modal.msg('物料属性不能为空');
|
||||
return;
|
||||
}
|
||||
this.productAttributeList.forEach((item) => {
|
||||
item.processName = this.dataForm.processName;
|
||||
item.processSize = this.dataForm.processSize;
|
||||
item.processDesc = this.dataForm.processDesc;
|
||||
});
|
||||
// 修改的提交
|
||||
updateProcess(this.productAttributeList).then((response) => {
|
||||
this.$modal.msgSuccess('提交成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
return;
|
||||
// 添加的提交
|
||||
createProcess(this.dataForm).then((response) => {
|
||||
createProcess(this.productAttributeList).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.$confirm(`是否新增产品属性?`, '系统提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
this.dataForm.id = response.data;
|
||||
this.addNew();
|
||||
})
|
||||
.catch(() => {
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -325,14 +291,10 @@ export default {
|
||||
},
|
||||
// 新增 / 修改
|
||||
addNew(id) {
|
||||
if (this.dataForm.id) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id);
|
||||
});
|
||||
} else {
|
||||
this.$message('请先创建配方!');
|
||||
}
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id, this.dataForm);
|
||||
});
|
||||
},
|
||||
goback() {
|
||||
this.$emit('refreshDataList');
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
:rules="dataRule"
|
||||
label-width="100px"
|
||||
@keyup.enter.native="dataFormSubmit()">
|
||||
<el-form-item label="设备" prop="equipmentId">
|
||||
<!-- <el-form-item label="设备" prop="equipmentId">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="dataForm.equipmentId"
|
||||
@@ -31,23 +31,26 @@
|
||||
:label="item.equipmentName"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="原料" prop="materialId">
|
||||
</el-form-item> -->
|
||||
<el-form-item label="物料" prop="materialId">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="dataForm.materialId"
|
||||
filterable
|
||||
@change="setMaterial"
|
||||
placeholder="请选择原料">
|
||||
placeholder="请选择物料">
|
||||
<el-option
|
||||
v-for="item in productArr"
|
||||
:key="item.id"
|
||||
:label="item.materialName"
|
||||
:label="
|
||||
item.materialCode + '-' + item.materialName + '-' + item.material
|
||||
"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="数量" prop="quantity">
|
||||
<el-form-item label="数量" prop="materialNumber">
|
||||
<el-input-number
|
||||
v-model="dataForm.quantity"
|
||||
v-model="dataForm.materialNumber"
|
||||
:step="1"
|
||||
step-strictly
|
||||
:min="0"></el-input-number>
|
||||
@@ -64,61 +67,56 @@
|
||||
<script>
|
||||
import {
|
||||
getProductPage,
|
||||
createProcessMaterial,
|
||||
getProcessMaterial,
|
||||
updateProcessMaterial,
|
||||
getEquipmentPage
|
||||
createProcess,
|
||||
getProcess,
|
||||
updateProcess,
|
||||
} from '@/api/ssdl/product&recipe';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
processId: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
equipmentId: '',
|
||||
equipmentCode: '',
|
||||
equipmentName: '',
|
||||
processId: '', // 配方id
|
||||
processName: '', // 配方型号
|
||||
processSize: '', // 配方规格
|
||||
processDesc: '', // 配方描述
|
||||
materialId: '',
|
||||
materialCode: '',
|
||||
material: '',
|
||||
materialName: '',
|
||||
quantity: '',
|
||||
materialNumber: '',
|
||||
},
|
||||
productArr: [],
|
||||
equipmentArr: [],
|
||||
equipmentArr: [],
|
||||
dataRule: {
|
||||
equipmentId: [
|
||||
{ required: true, message: '设备不能为空', trigger: 'change' },
|
||||
],
|
||||
materialId: [
|
||||
{ required: true, message: '原料不能为空', trigger: 'change' },
|
||||
{ required: true, message: '物料不能为空', trigger: 'change' },
|
||||
],
|
||||
quantity: [
|
||||
materialNumber: [
|
||||
{ required: true, message: '数量不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
init(id,data) {
|
||||
this.dataForm.id = id || '';
|
||||
this.dataForm.processId = data.id || '';
|
||||
this.dataForm.processName = data.processName || '';
|
||||
this.dataForm.processSize = data.processSize || '';
|
||||
this.dataForm.processDesc = data.processDesc || '';
|
||||
this.visible = true;
|
||||
getProductPage({ pageNo: 1, pageSize: 100 }).then((res) => {
|
||||
this.productArr = res.data.list;
|
||||
});
|
||||
getEquipmentPage({ pageNo: 1, pageSize: 100 }).then((res) => {
|
||||
this.equipmentArr = res.data.list;
|
||||
});
|
||||
// getEquipmentPage({ pageNo: 1, pageSize: 100 }).then((res) => {
|
||||
// this.equipmentArr = res.data.list;
|
||||
// });
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
getProcessMaterial(this.dataForm.id).then((res) => {
|
||||
getProcess(this.dataForm.id).then((res) => {
|
||||
this.dataForm = res.data;
|
||||
});
|
||||
}
|
||||
@@ -129,14 +127,7 @@ export default {
|
||||
(i) => i.id === this.dataForm.materialId
|
||||
);
|
||||
this.dataForm.materialName = data.materialName;
|
||||
this.dataForm.materialCode = data.materialCode;
|
||||
},
|
||||
setEquipment() {
|
||||
const data = this.equipmentArr.find(
|
||||
(i) => i.id === this.dataForm.equipmentId
|
||||
);
|
||||
this.dataForm.equipmentName = data.equipmentName;
|
||||
this.dataForm.equipmentCode = data.equipmentCode;
|
||||
this.dataForm.material = data.material;
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
@@ -144,10 +135,9 @@ export default {
|
||||
if (valid) {
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
updateProcessMaterial({
|
||||
updateProcess([{
|
||||
...this.dataForm,
|
||||
processId: this.processId,
|
||||
}).then((response) => {
|
||||
}]).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
@@ -155,10 +145,9 @@ export default {
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createProcessMaterial({
|
||||
createProcess([{
|
||||
...this.dataForm,
|
||||
processId: this.processId,
|
||||
}).then((response) => {
|
||||
}]).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 14:55:51
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-19 13:21:53
|
||||
* @LastEditTime: 2025-11-28 14:34:11
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -11,19 +11,53 @@
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-data="tableData">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:header-cell-style="{
|
||||
background: '#F2F4F9',
|
||||
color: '#606266',
|
||||
}"
|
||||
border
|
||||
style="width: 100%"
|
||||
ref="dataList">
|
||||
<el-table-column type="expand">
|
||||
<template slot-scope="scope">
|
||||
<product
|
||||
:processName="scope.row.processName"
|
||||
:processSize="scope.row.processSize"></product>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="processName" label="配方型号" />
|
||||
<el-table-column prop="processSize" label="配方规格" />
|
||||
<el-table-column prop="processDesc" label="配方描述" />
|
||||
<el-table-column prop="createTime" label="创建时间" width="150">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleClick({ data: { ...scope.row }, type: 'edit' })">
|
||||
<span class="iconfont icon-edit primary-color"></span>
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleClick({ data: { ...scope.row }, type: 'delete' })">
|
||||
<span class="iconfont icon-delete" style="color: #f56c6c"></span>
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleClick({ data: { ...scope.row }, type: 'detail' })">
|
||||
<span class="iconfont icon-detail primary-color"></span>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page.sync="listQuery.pageNo"
|
||||
@@ -38,37 +72,14 @@
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import product from './product-mini';
|
||||
import basicPage from '@/mixins/basic-page';
|
||||
import { parseTime } from '@/filter/code-filter';
|
||||
import { deleteProcess, getProcessPage } from '@/api/ssdl/product&recipe';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
filter: parseTime
|
||||
},
|
||||
{
|
||||
prop: 'processName',
|
||||
label: '配方名称'
|
||||
},
|
||||
{
|
||||
prop: 'processCode',
|
||||
label: '配方编码'
|
||||
},
|
||||
{
|
||||
prop: 'materialName',
|
||||
label: '产品名称'
|
||||
},
|
||||
{
|
||||
prop: 'materialCode',
|
||||
label: '产品编码'
|
||||
},
|
||||
{
|
||||
prop: 'processDesc',
|
||||
label: '配方描述'
|
||||
},
|
||||
];
|
||||
import {
|
||||
deleteProcessList,
|
||||
getProcessPage,
|
||||
getProcessDetailPage,
|
||||
} from '@/api/ssdl/product&recipe';
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
@@ -76,46 +87,48 @@ export default {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getProcessPage,
|
||||
deleteURL: deleteProcess,
|
||||
deleteURL: deleteProcessList,
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
},{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
},{
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
},
|
||||
tableBtn: [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
},
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
},
|
||||
{
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
},
|
||||
].filter((v) => v),
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '配方编码',
|
||||
placeholder: '配方编码',
|
||||
param: 'code1',
|
||||
label: '配方型号',
|
||||
placeholder: '配方型号',
|
||||
param: 'val1',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '配方名称',
|
||||
placeholder: '配方名称',
|
||||
param: 'name1',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '产品编码',
|
||||
placeholder: '产品编码',
|
||||
param: 'code2',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '产品名称',
|
||||
placeholder: '产品名称',
|
||||
param: 'name2',
|
||||
label: '配方规格',
|
||||
placeholder: '配方规格',
|
||||
param: 'val2',
|
||||
},
|
||||
// {
|
||||
// type: 'input',
|
||||
// label: '物料型号',
|
||||
// placeholder: '物料型号',
|
||||
// param: 'val3',
|
||||
// },
|
||||
// {
|
||||
// type: 'input',
|
||||
// label: '物料编码',
|
||||
// placeholder: '物料编码',
|
||||
// param: 'val4',
|
||||
// },
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '搜索',
|
||||
@@ -155,6 +168,7 @@ export default {
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
product,
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
@@ -163,10 +177,10 @@ export default {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.processName = val.name1 || null;
|
||||
this.listQuery.processCode = val.code1 || null;
|
||||
this.listQuery.materialName = val.name2 || null;
|
||||
this.listQuery.materialCode = val.code2 || null;
|
||||
this.listQuery.processName = val.val1 || null;
|
||||
this.listQuery.processSize = val.val2 || null;
|
||||
// this.listQuery.materialName = val.val3 || null;
|
||||
// this.listQuery.materialCode = val.val4 || null;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'reset':
|
||||
@@ -197,27 +211,48 @@ export default {
|
||||
this.$refs.addOrUpdate.init(val.data.id, true);
|
||||
});
|
||||
},
|
||||
// 删除
|
||||
deleteHandle(id, name, index,data) {
|
||||
this.$confirm(`是否确认删除${'配方名称为 ' + data.processName + ' '}的数据项?`, "系统提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.urlOptions.deleteURL(id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
},
|
||||
// 删除
|
||||
deleteHandle(id, name, index, data) {
|
||||
this.$confirm(
|
||||
`是否确认删除${'配方型号为 ' + data.processName + ' '}的数据项?`,
|
||||
'系统提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
// 获取物料的属性列表
|
||||
getProcessDetailPage({
|
||||
processName: data.processName,
|
||||
processSize: data.processSize,
|
||||
pageSize: 100,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
}).then((response) => {
|
||||
const ids = response.data.map((i) => i.id);
|
||||
this.urlOptions.deleteURL(ids).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.app-container .el-table .el-table__cell {
|
||||
padding: 0;
|
||||
height: 35px;
|
||||
}
|
||||
</style>
|
||||
|
||||
85
src/views/product&recipe/recipe/product-mini.vue
Normal file
85
src/views/product&recipe/recipe/product-mini.vue
Normal file
@@ -0,0 +1,85 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-24 14:47:58
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-28 10:06:06
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<!-- <div class="app-container"> -->
|
||||
<base-table
|
||||
v-loading="dataListLoading"
|
||||
:table-props="tableProps"
|
||||
max-height="200"
|
||||
:page="1"
|
||||
:limit="listQuery.total"
|
||||
:table-data="tableData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from '@/mixins/basic-page';
|
||||
import { parseTime } from '@/filter/code-filter';
|
||||
import { getProcessDetailPage } from '@/api/ssdl/product&recipe';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'materialName',
|
||||
label: '物料型号',
|
||||
},
|
||||
{
|
||||
prop: 'material',
|
||||
label: '物料规格',
|
||||
},
|
||||
{
|
||||
prop: 'materialNumber',
|
||||
label: '物料数量',
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
props: {
|
||||
processSize: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
processName: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getProcessDetailPage,
|
||||
},
|
||||
tableProps,
|
||||
tableData: [],
|
||||
listQuery: {
|
||||
processName: this.processName,
|
||||
processSize: this.processSize,
|
||||
pageSize: 100,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
},
|
||||
};
|
||||
},
|
||||
components: {
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
||||
this.tableData = response.data;
|
||||
this.listQuery.total = response.data.total;
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user