更新 #454

Merged
zwq merged 1 commits from projects/ssdl-zwq into projects/ssdl-test 2025-11-28 16:28:10 +08:00
9 changed files with 355 additions and 269 deletions
Showing only changes of commit 48e9f70625 - Show all commits

View File

@@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2025-11-17 09:25:12 * @Date: 2025-11-17 09:25:12
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2025-11-19 13:11:54 * @LastEditTime: 2025-11-28 09:29:14
* @Description: * @Description:
*/ */
import request from '@/utils/request' import request from '@/utils/request'
@@ -52,7 +52,15 @@ export function createProduct(data) {
// 获得工艺分页 // 获得工艺分页
export function getProcessPage(query) { export function getProcessPage(query) {
return request({ 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', method: 'get',
params: query params: query
}) })
@@ -64,6 +72,13 @@ export function deleteProcess(id) {
method: 'delete' method: 'delete'
}) })
} }
// 批量删除工艺
export function deleteProcessList(ids) {
return request({
url: '/wms/process/delete-list?ids=' + ids,
method: 'delete'
})
}
// 更新 // 更新
export function updateProcess(data) { export function updateProcess(data) {
return request({ return request({

View File

@@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2022-08-24 11:19:43 * @Date: 2022-08-24 11:19:43
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2025-11-19 13:20:30 * @LastEditTime: 2025-11-28 09:35:03
* @Description: * @Description:
*/ */
export default { export default {
@@ -16,7 +16,7 @@ export default {
}, },
tableData: [], //table数据 tableData: [], //table数据
listQuery: { //分页 listQuery: { //分页
pageSize: 10, pageSize: 20,
pageNo: 1, pageNo: 1,
total: 1, total: 1,
}, },

View File

@@ -284,7 +284,7 @@ export default {
mobile: '', mobile: '',
mobileCode: '', mobileCode: '',
rememberMe: false, rememberMe: false,
tenantName: '技术中心', tenantName: '芋道源码',
}, },
scene: 21, scene: 21,

View File

@@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2025-11-18 15:01:42 * @LastEditTime: 2025-11-28 14:38:31
* @Description: * @Description:
--> -->
<template> <template>
@@ -14,29 +14,29 @@
label-width="80px"> label-width="80px">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="产品编码" prop="materialCode"> <el-form-item label="物料编码" prop="materialCode">
<el-input <el-input
v-model="dataForm.materialCode" v-model="dataForm.materialCode"
clearable clearable
placeholder="请输入产品编码" /> placeholder="请输入物料编码" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="产品名称" prop="materialName"> <el-form-item label="物料型号" prop="materialName">
<el-input <el-input
v-model="dataForm.materialName" v-model="dataForm.materialName"
clearable clearable
placeholder="请输入产品名称" /> placeholder="请输入物料型号" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="产品规格" prop="material"> <el-form-item label="物料规格" prop="material">
<el-input <el-input
v-model="dataForm.material" v-model="dataForm.material"
clearable clearable
placeholder="请输入产品规格" /> placeholder="请输入物料规格" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@@ -65,10 +65,10 @@ export default {
typeArr: [], typeArr: [],
dataRule: { dataRule: {
materialCode: [ materialCode: [
{ required: true, message: '产品编码不能为空', trigger: 'blur' }, { required: true, message: '物料编码不能为空', trigger: 'blur' },
], ],
materialName: [ materialName: [
{ required: true, message: '产品名称不能为空', trigger: 'blur' }, { required: true, message: '物料型号不能为空', trigger: 'blur' },
], ],
material: [ material: [
{ required: true, message: '规格不能为空', trigger: 'blur' }, { required: true, message: '规格不能为空', trigger: 'blur' },

View File

@@ -47,15 +47,15 @@ import { deleteProduct, getProductPage } from '@/api/ssdl/product&recipe';
const tableProps = [ const tableProps = [
{ {
prop: 'materialCode', prop: 'materialCode',
label: '产品编码', label: '物料编码',
}, },
{ {
prop: 'materialName', prop: 'materialName',
label: '产品名称', label: '物料型号',
}, },
{ {
prop: 'material', prop: 'material',
label: '规格型号', label: '规格',
}, },
{ {
prop: 'creator', prop: 'creator',
@@ -92,8 +92,8 @@ export default {
formConfig: [ formConfig: [
{ {
type: 'input', type: 'input',
label: '名称', label: '型号',
placeholder: '名称', placeholder: '型号',
param: 'name', param: 'name',
}, },
{ {
@@ -175,7 +175,7 @@ export default {
}, },
// 删除 // 删除
deleteHandle(id, name, index,data) { deleteHandle(id, name, index,data) {
this.$confirm(`是否确认删除${'产品名称为 ' + data.materialName + ' '}的数据项?`, "系统提示", { this.$confirm(`是否确认删除${'物料型号为 ' + data.materialName + ' '}的数据项?`, "系统提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",

View File

@@ -19,41 +19,25 @@
label-position="top" label-position="top"
@keyup.enter.native="dataFormSubmit"> @keyup.enter.native="dataFormSubmit">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="8">
<el-form-item label="配方编码" prop="processCode"> <el-form-item label="配方规格" prop="processSize">
<el-input <el-input
v-model="dataForm.processCode" v-model="dataForm.processSize"
clearable clearable
:disabled="isdetail" :disabled="isdetail"
placeholder="请输入配方编码" /> placeholder="请输入配方规格" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<el-form-item label="配方名称" prop="processName"> <el-form-item label="配方型号" prop="processName">
<el-input <el-input
v-model="dataForm.processName" v-model="dataForm.processName"
clearable clearable
:disabled="isdetail" :disabled="isdetail"
placeholder="请输入配方名称" /> placeholder="请输入配方型号" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="8">
<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-form-item label="配方描述" prop="processDesc"> <el-form-item label="配方描述" prop="processDesc">
<el-input <el-input
v-model="dataForm.processDesc" v-model="dataForm.processDesc"
@@ -68,16 +52,20 @@
<small-title <small-title
style="margin: 16px 0; padding-left: 8px" style="margin: 16px 0; padding-left: 8px"
:no-padding="true" :no-padding="true"
v-if="dataForm.id"> v-if="dataForm.processName && dataForm.processSize">
产品属性列表 物料属性列表
</small-title> </small-title>
<div class="attr-list" v-if="dataForm.id"> <div
class="attr-list"
v-if="dataForm.processName && dataForm.processSize">
<base-table <base-table
:table-props="tableProps" :table-props="tableProps"
:page="listQuery.pageNo" :page="listQuery.pageNo"
:limit="listQuery.pageSize" :limit="listQuery.pageSize"
:add-button-show="isdetail ? null : '添加属性'" :add-button-show="
productAttributeList.length > 3 || isdetail ? null : '添加属性'
"
@emitButtonClick="addNew()" @emitButtonClick="addNew()"
:table-data="productAttributeList"> :table-data="productAttributeList">
<method-btn <method-btn
@@ -112,7 +100,6 @@
<product-attr-add <product-attr-add
v-if="addOrUpdateVisible" v-if="addOrUpdateVisible"
ref="addOrUpdate" ref="addOrUpdate"
:process-id="dataForm.id"
@refreshDataList="getList" /> @refreshDataList="getList" />
</el-drawer> </el-drawer>
</template> </template>
@@ -122,9 +109,8 @@ import {
updateProcess, updateProcess,
createProcess, createProcess,
getProcess, getProcess,
getProcessMaterialPage, getProcessDetailPage,
deleteProcessMaterial, deleteProcess,
getProductPage,
} from '@/api/ssdl/product&recipe'; } from '@/api/ssdl/product&recipe';
import productAttrAdd from './attr-add'; import productAttrAdd from './attr-add';
import { parseTime } from '@/filter/code-filter'; import { parseTime } from '@/filter/code-filter';
@@ -146,17 +132,17 @@ const tableProps = [
label: '添加时间', label: '添加时间',
filter: parseTime, filter: parseTime,
}, },
{
prop: 'equipmentName',
label: '设备名称',
},
{ {
prop: 'materialName', prop: 'materialName',
label: '原料名称', label: '物料型号',
}, },
{ {
prop: 'quantity', prop: 'material',
label: '数量', label: '物料规格',
},
{
prop: 'materialNumber',
label: '物料数量',
}, },
]; ];
@@ -171,41 +157,30 @@ export default {
productAttributeList: [], productAttributeList: [],
dataForm: { dataForm: {
id: null, id: null,
processName: '', // 配方名称 processName: '', // 配方型号
processCode: '', // 配方编码 processSize: '', // 配方规格
processDesc: '', // 配方描述 processDesc: '', // 配方描述
materialId: '', // 物料id
materialName: '', // 物料名称
materialCode: '', // 物料编码
}, },
productArr: [],
listQuery: { listQuery: {
pageSize: 10, pageSize: 10,
pageNo: 1, pageNo: 1,
total: 0, total: 0,
}, },
dataRule: { dataRule: {
processCode: [ processSize: [
{ {
required: true, required: true,
message: '配方编码不能为空', message: '配方规格不能为空',
trigger: 'blur', trigger: 'blur',
}, },
], ],
processName: [ processName: [
{ {
required: true, required: true,
message: '配方名称不能为空', message: '配方型号不能为空',
trigger: 'blur', trigger: 'blur',
}, },
], ],
materialId: [
{
required: true,
message: '物料不能为空',
trigger: 'change',
},
],
}, },
isdetail: false, isdetail: false,
}; };
@@ -217,9 +192,6 @@ export default {
}, },
init(id, isdetail) { init(id, isdetail) {
this.initData(); this.initData();
getProductPage({ pageNo: 1, pageSize: 100 }).then((res) => {
this.productArr = res.data.list;
});
this.isdetail = isdetail || false; this.isdetail = isdetail || false;
this.dataForm.id = id || null; this.dataForm.id = id || null;
this.visible = true; this.visible = true;
@@ -228,31 +200,26 @@ export default {
this.$refs['dataForm'].resetFields(); this.$refs['dataForm'].resetFields();
if (this.dataForm.id) { if (this.dataForm.id) {
// 获取产品详情 // 获取物料详情
getProcess(id).then((response) => { getProcess(id).then((response) => {
this.dataForm = response.data; 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() { getList() {
// 获取产品的属性列表 // 获取物料的属性列表
getProcessMaterialPage({ getProcessDetailPage({
...this.listQuery, processName: this.dataForm.processName,
productId: this.dataForm.id, processSize: this.dataForm.processSize,
pageSize: 100,
pageNo: 1,
total: 1,
}).then((response) => { }).then((response) => {
this.productAttributeList = response.data.list; this.productAttributeList = response.data;
this.listQuery.total = response.data.total;
}); });
}, },
handleClick(raw) { handleClick(raw) {
@@ -271,7 +238,7 @@ export default {
} }
) )
.then(() => { .then(() => {
deleteProcessMaterial(raw.data.id).then(({ data }) => { deleteProcess(raw.data.id).then(({ data }) => {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
@@ -291,31 +258,30 @@ export default {
dataFormSubmit() { dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (valid) { if (valid) {
// 修改的提交 if (
if (this.dataForm.id) { !this.productAttributeList ||
updateProcess(this.dataForm).then((response) => { !(this.productAttributeList.length > 0)
this.$modal.msgSuccess('修改成功'); ) {
this.visible = false; this.$modal.msg('物料属性不能为空');
this.$emit('refreshDataList');
});
return; 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.$modal.msgSuccess('新增成功');
this.$confirm(`是否新增产品属性?`, '系统提示', { this.visible = false;
confirmButtonText: '确定', this.$emit('refreshDataList');
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
this.dataForm.id = response.data;
this.addNew();
})
.catch(() => {
this.visible = false;
this.$emit('refreshDataList');
});
}); });
} }
}); });
@@ -325,14 +291,10 @@ export default {
}, },
// 新增 / 修改 // 新增 / 修改
addNew(id) { addNew(id) {
if (this.dataForm.id) { this.addOrUpdateVisible = true;
this.addOrUpdateVisible = true; this.$nextTick(() => {
this.$nextTick(() => { this.$refs.addOrUpdate.init(id, this.dataForm);
this.$refs.addOrUpdate.init(id); });
});
} else {
this.$message('请先创建配方!');
}
}, },
goback() { goback() {
this.$emit('refreshDataList'); this.$emit('refreshDataList');

View File

@@ -19,7 +19,7 @@
:rules="dataRule" :rules="dataRule"
label-width="100px" label-width="100px"
@keyup.enter.native="dataFormSubmit()"> @keyup.enter.native="dataFormSubmit()">
<el-form-item label="设备" prop="equipmentId"> <!-- <el-form-item label="设备" prop="equipmentId">
<el-select <el-select
style="width: 100%" style="width: 100%"
v-model="dataForm.equipmentId" v-model="dataForm.equipmentId"
@@ -31,23 +31,26 @@
:label="item.equipmentName" :label="item.equipmentName"
:value="item.id"></el-option> :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item> -->
<el-form-item label="料" prop="materialId"> <el-form-item label="料" prop="materialId">
<el-select <el-select
style="width: 100%" style="width: 100%"
v-model="dataForm.materialId" v-model="dataForm.materialId"
filterable
@change="setMaterial" @change="setMaterial"
placeholder="请选择料"> placeholder="请选择料">
<el-option <el-option
v-for="item in productArr" v-for="item in productArr"
:key="item.id" :key="item.id"
:label="item.materialName" :label="
item.materialCode + '-' + item.materialName + '-' + item.material
"
:value="item.id"></el-option> :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="数量" prop="quantity"> <el-form-item label="数量" prop="materialNumber">
<el-input-number <el-input-number
v-model="dataForm.quantity" v-model="dataForm.materialNumber"
:step="1" :step="1"
step-strictly step-strictly
:min="0"></el-input-number> :min="0"></el-input-number>
@@ -64,61 +67,56 @@
<script> <script>
import { import {
getProductPage, getProductPage,
createProcessMaterial, createProcess,
getProcessMaterial, getProcess,
updateProcessMaterial, updateProcess,
getEquipmentPage
} from '@/api/ssdl/product&recipe'; } from '@/api/ssdl/product&recipe';
export default { export default {
props: {
processId: {
type: String,
default: '',
},
},
data() { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
equipmentId: '', processId: '', // 配方id
equipmentCode: '', processName: '', // 配方型号
equipmentName: '', processSize: '', // 配方规格
processDesc: '', // 配方描述
materialId: '', materialId: '',
materialCode: '', material: '',
materialName: '', materialName: '',
quantity: '', materialNumber: '',
}, },
productArr: [], productArr: [],
equipmentArr: [], equipmentArr: [],
dataRule: { dataRule: {
equipmentId: [
{ required: true, message: '设备不能为空', trigger: 'change' },
],
materialId: [ materialId: [
{ required: true, message: '料不能为空', trigger: 'change' }, { required: true, message: '料不能为空', trigger: 'change' },
], ],
quantity: [ materialNumber: [
{ required: true, message: '数量不能为空', trigger: 'blur' }, { required: true, message: '数量不能为空', trigger: 'blur' },
], ],
}, },
}; };
}, },
methods: { methods: {
init(id) { init(id,data) {
this.dataForm.id = id || ''; 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; this.visible = true;
getProductPage({ pageNo: 1, pageSize: 100 }).then((res) => { getProductPage({ pageNo: 1, pageSize: 100 }).then((res) => {
this.productArr = res.data.list; this.productArr = res.data.list;
}); });
getEquipmentPage({ pageNo: 1, pageSize: 100 }).then((res) => { // getEquipmentPage({ pageNo: 1, pageSize: 100 }).then((res) => {
this.equipmentArr = res.data.list; // this.equipmentArr = res.data.list;
}); // });
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields(); this.$refs['dataForm'].resetFields();
if (this.dataForm.id) { if (this.dataForm.id) {
getProcessMaterial(this.dataForm.id).then((res) => { getProcess(this.dataForm.id).then((res) => {
this.dataForm = res.data; this.dataForm = res.data;
}); });
} }
@@ -129,14 +127,7 @@ export default {
(i) => i.id === this.dataForm.materialId (i) => i.id === this.dataForm.materialId
); );
this.dataForm.materialName = data.materialName; this.dataForm.materialName = data.materialName;
this.dataForm.materialCode = data.materialCode; this.dataForm.material = data.material;
},
setEquipment() {
const data = this.equipmentArr.find(
(i) => i.id === this.dataForm.equipmentId
);
this.dataForm.equipmentName = data.equipmentName;
this.dataForm.equipmentCode = data.equipmentCode;
}, },
// 表单提交 // 表单提交
dataFormSubmit() { dataFormSubmit() {
@@ -144,10 +135,9 @@ export default {
if (valid) { if (valid) {
// 修改的提交 // 修改的提交
if (this.dataForm.id) { if (this.dataForm.id) {
updateProcessMaterial({ updateProcess([{
...this.dataForm, ...this.dataForm,
processId: this.processId, }]).then((response) => {
}).then((response) => {
this.$modal.msgSuccess('修改成功'); this.$modal.msgSuccess('修改成功');
this.visible = false; this.visible = false;
this.$emit('refreshDataList'); this.$emit('refreshDataList');
@@ -155,10 +145,9 @@ export default {
return; return;
} }
// 添加的提交 // 添加的提交
createProcessMaterial({ createProcess([{
...this.dataForm, ...this.dataForm,
processId: this.processId, }]).then((response) => {
}).then((response) => {
this.$modal.msgSuccess('新增成功'); this.$modal.msgSuccess('新增成功');
this.visible = false; this.visible = false;
this.$emit('refreshDataList'); this.$emit('refreshDataList');

View File

@@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 14:55:51 * @Date: 2023-08-01 14:55:51
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2025-11-19 13:21:53 * @LastEditTime: 2025-11-28 14:34:11
* @Description: * @Description:
--> -->
<template> <template>
@@ -11,19 +11,53 @@
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" /> @headBtnClick="buttonClick" />
<base-table <el-table
:table-props="tableProps" :data="tableData"
:page="listQuery.pageNo" :header-cell-style="{
:limit="listQuery.pageSize" background: '#F2F4F9',
:table-data="tableData"> color: '#606266',
<method-btn }"
v-if="tableBtn.length" border
slot="handleBtn" style="width: 100%"
:width="120" ref="dataList">
label="操作" <el-table-column type="expand">
:method-list="tableBtn" <template slot-scope="scope">
@clickBtn="handleClick" /> <product
</base-table> :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 <pagination
:limit.sync="listQuery.pageSize" :limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo" :page.sync="listQuery.pageNo"
@@ -38,37 +72,14 @@
<script> <script>
import AddOrUpdate from './add-or-updata'; import AddOrUpdate from './add-or-updata';
import product from './product-mini';
import basicPage from '@/mixins/basic-page'; import basicPage from '@/mixins/basic-page';
import { parseTime } from '@/filter/code-filter'; import { parseTime } from '@/filter/code-filter';
import { deleteProcess, getProcessPage } from '@/api/ssdl/product&recipe'; import {
deleteProcessList,
const tableProps = [ getProcessPage,
{ getProcessDetailPage,
prop: 'createTime', } from '@/api/ssdl/product&recipe';
label: '创建时间',
filter: parseTime
},
{
prop: 'processName',
label: '配方名称'
},
{
prop: 'processCode',
label: '配方编码'
},
{
prop: 'materialName',
label: '产品名称'
},
{
prop: 'materialCode',
label: '产品编码'
},
{
prop: 'processDesc',
label: '配方描述'
},
];
export default { export default {
mixins: [basicPage], mixins: [basicPage],
@@ -76,46 +87,48 @@ export default {
return { return {
urlOptions: { urlOptions: {
getDataListURL: getProcessPage, getDataListURL: getProcessPage,
deleteURL: deleteProcess, deleteURL: deleteProcessList,
}, },
tableProps, tableBtn: [
tableBtn: [{ {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',
},{ },
type: 'delete', {
btnName: '删除', type: 'delete',
},{ btnName: '删除',
type: 'detail', },
btnName: '详情', {
}, type: 'detail',
btnName: '详情',
},
].filter((v) => v), ].filter((v) => v),
tableData: [], tableData: [],
formConfig: [ formConfig: [
{ {
type: 'input', type: 'input',
label: '配方编码', label: '配方型号',
placeholder: '配方编码', placeholder: '配方型号',
param: 'code1', param: 'val1',
}, },
{ {
type: 'input', type: 'input',
label: '配方名称', label: '配方规格',
placeholder: '配方名称', placeholder: '配方规格',
param: 'name1', param: 'val2',
},
{
type: 'input',
label: '产品编码',
placeholder: '产品编码',
param: 'code2',
},
{
type: 'input',
label: '产品名称',
placeholder: '产品名称',
param: 'name2',
}, },
// {
// type: 'input',
// label: '物料型号',
// placeholder: '物料型号',
// param: 'val3',
// },
// {
// type: 'input',
// label: '物料编码',
// placeholder: '物料编码',
// param: 'val4',
// },
{ {
type: 'button', type: 'button',
btnName: '搜索', btnName: '搜索',
@@ -155,6 +168,7 @@ export default {
}, },
components: { components: {
AddOrUpdate, AddOrUpdate,
product,
}, },
created() {}, created() {},
methods: { methods: {
@@ -163,10 +177,10 @@ export default {
case 'search': case 'search':
this.listQuery.pageNo = 1; this.listQuery.pageNo = 1;
this.listQuery.pageSize = 20; this.listQuery.pageSize = 20;
this.listQuery.processName = val.name1 || null; this.listQuery.processName = val.val1 || null;
this.listQuery.processCode = val.code1 || null; this.listQuery.processSize = val.val2 || null;
this.listQuery.materialName = val.name2 || null; // this.listQuery.materialName = val.val3 || null;
this.listQuery.materialCode = val.code2 || null; // this.listQuery.materialCode = val.val4 || null;
this.getDataList(); this.getDataList();
break; break;
case 'reset': case 'reset':
@@ -197,27 +211,48 @@ export default {
this.$refs.addOrUpdate.init(val.data.id, true); this.$refs.addOrUpdate.init(val.data.id, true);
}); });
}, },
// 删除 // 删除
deleteHandle(id, name, index,data) { deleteHandle(id, name, index, data) {
this.$confirm(`是否确认删除${'配方名称为 ' + data.processName + ' '}的数据项?`, "系统提示", { this.$confirm(
confirmButtonText: "确定", `是否确认删除${'配方型号为 ' + data.processName + ' '}的数据项?`,
cancelButtonText: "取消", '系统提示',
type: "warning", {
}) confirmButtonText: '确定',
.then(() => { cancelButtonText: '取消',
this.urlOptions.deleteURL(id).then(({ data }) => { type: 'warning',
this.$message({ }
message: "操作成功", )
type: "success", .then(() => {
duration: 1500, // 获取物料的属性列表
onClose: () => { getProcessDetailPage({
this.getDataList(); processName: data.processName,
}, processSize: data.processSize,
}); pageSize: 100,
}); pageNo: 1,
}) total: 1,
.catch(() => { }); }).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> </script>
<style>
.app-container .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View 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>