更新装配、精工车间、技术中心、仓储模块,新增工序工价、生产审核、三楼仓库可视化等功能及文档SQL

This commit is contained in:
Developer
2026-07-06 11:21:59 +08:00
parent be0ff91e24
commit 9c1f52078d
43 changed files with 8566 additions and 233 deletions

View File

@@ -0,0 +1,774 @@
<template>
<div class="app-container">
<el-card style="height: 850px;padding: 0">
<!-- 修改人:Ld 修改时间:2026-07-06 08:36:02 -->
<!-- 参考制定工艺组件的订单产品零件查询入口 -->
<div class="toolbar">
<el-select v-model="queryForm.订单流水号" clearable filterable size="small" style="width: 170px" placeholder="订单号" @change="handleOrderChange">
<el-option v-for="item in orderNumberType" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-select v-model="queryForm.组件流水号" clearable filterable size="small" style="width: 190px" placeholder="产品名称" @change="handleProductChange">
<el-option v-for="item in productName" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-select v-model="queryForm.工艺计划流水号" clearable filterable size="small" style="width: 220px" placeholder="零件名称" @change="pageCurrent = 1;searchTable()">
<el-option v-for="item in partName" :key="item.value" :label="item.label" :value="item.value">
<span style="float: left">{{ item.label }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</span>
</el-option>
</el-select>
<el-select v-model="queryForm.是否启用" clearable filterable size="small" style="width: 120px" placeholder="启用状态" @change="pageCurrent = 1;searchTable()">
<el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-input v-model="queryForm.工序名称" clearable size="small" style="width: 150px" placeholder="工序名称" @keyup.enter.native="pageCurrent = 1;searchTable()" />
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 10px" @click="pageCurrent = 1;searchTable()">查询</el-button>
<el-button :disabled="!queryForm.工艺计划流水号" icon="el-icon-document-copy" type="warning" plain size="small" @click="openCopyDialog()">拷贝</el-button>
</div>
<!-- 修改人:Ld 修改时间:2026-07-02 15:33:23 -->
<!-- 工序工价列表 -->
<el-table
v-loading="loading"
:data="tableData"
border
highlight-current-row
stripe
size="mini"
height="720"
style="width: 100%;">
<el-table-column type="index" label="序号" align="center" width="60" />
<el-table-column label="订单号" align="center" show-overflow-tooltip width="140">
<template slot-scope="scope">
{{ scope.row.订单号 }}
</template>
</el-table-column>
<el-table-column label="产品名称" align="center" show-overflow-tooltip width="140">
<template slot-scope="scope">
{{ scope.row.产品名称 }}
</template>
</el-table-column>
<el-table-column label="工序名称" align="center" show-overflow-tooltip width="150">
<template slot-scope="scope">
{{ scope.row.工序名称 }}
</template>
</el-table-column>
<el-table-column label="零件名称" align="center" show-overflow-tooltip width="150">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="图号" align="center" show-overflow-tooltip width="120">
<template slot-scope="scope">
{{ scope.row.图号 }}
</template>
</el-table-column>
<el-table-column label="工序顺序" align="center" width="80">
<template slot-scope="scope">
{{ scope.row.工序顺序 }}
</template>
</el-table-column>
<el-table-column label="定额工时" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.定额工时 }}
</template>
</el-table-column>
<el-table-column label="准结工时" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.准结工时 }}
</template>
</el-table-column>
<el-table-column label="机动时间s" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.机动时间s }}
</template>
</el-table-column>
<el-table-column label="辅助时间s" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.辅助时间s }}
</template>
</el-table-column>
<el-table-column label="总时间s" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.总时间s }}
</template>
</el-table-column>
<el-table-column label="单装数量(件)" align="center" width="110">
<template slot-scope="scope">
{{ scope.row['单装数量(件)'] }}
</template>
</el-table-column>
<el-table-column label="操作台数" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.操作台数 }}
</template>
</el-table-column>
<el-table-column label="日产能(件)" align="center" width="100">
<template slot-scope="scope">
{{ scope.row['日产能(件)'] }}
</template>
</el-table-column>
<el-table-column label="最终单价(元/件)" align="center" width="130">
<template slot-scope="scope">
{{ scope.row['最终单价(元/件)'] }}
</template>
</el-table-column>
<el-table-column label="生效日期" align="center" width="110">
<template slot-scope="scope">
{{ scope.row.生效日期 }}
</template>
</el-table-column>
<el-table-column label="变更次数" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.变更次数 }}
</template>
</el-table-column>
<el-table-column label="启用状态" align="center" width="90">
<template slot-scope="scope">
<el-tag :type="Number(scope.row.是否启用) === 1 ? 'success' : 'info'" size="mini">
{{ Number(scope.row.是否启用) === 1 ? '启用' : '停用' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="备注" align="center" show-overflow-tooltip min-width="140">
<template slot-scope="scope">
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="170" fixed="right">
<template slot-scope="scope">
<el-button type="text" size="mini" icon="el-icon-edit-outline" @click="openEditDialog(scope.row)">设置</el-button>
<el-button :disabled="!scope.row.工价流水号" type="text" size="mini" icon="el-icon-document" @click="openHistoryDialog(scope.row)">历史</el-button>
<el-button :disabled="!scope.row.工价流水号" type="text" size="mini" icon="el-icon-turn-off" style="color:#f56c6c" @click="handleDisable(scope.row)">停用</el-button>
</template>
</el-table-column>
</el-table>
<!-- 修改人:Ld 修改时间:2026-07-02 15:33:23 -->
<!-- 分页 -->
<div class="block" style="margin-top: 10px;">
<!-- 修改人:Ld 修改时间:2026-07-06 08:52:37 -->
<!-- 工序工价数据量超过 100 放开分页条数选择 -->
<el-pagination
:current-page="pageCurrent"
:page-sizes="[20, 50, 100, 200, 500, 1000]"
:page-size="pageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange" />
</div>
</el-card>
<!-- 修改人:Ld 修改时间:2026-07-02 15:33:23 -->
<!-- 工价设置弹窗 -->
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible" :title="dialogTitle" center width="960px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="100px">
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="工艺名称" prop="工艺名称">
<el-input v-model="form.工艺名称" disabled size="small" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工序名称" prop="工序名称">
<el-input v-model="form.工序名称" disabled size="small" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="零件名称" prop="零件名称">
<el-input v-model="form.零件名称" disabled size="small" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="图号" prop="图号">
<el-input v-model="form.图号" disabled size="small" />
</el-form-item>
</el-col>
</el-row>
<!-- 修改人:Ld 修改时间:2026-07-03 08:02:29 -->
<!-- 按现场确认的 9 个工价字段维护 -->
<el-row :gutter="16">
<el-col :span="8">
<el-form-item label="机动时间s" prop="机动时间s">
<el-input-number v-model="form.机动时间s" :min="0" :precision="2" :step="1" controls-position="right" style="width: 100%;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="辅助时间s" prop="辅助时间s">
<el-input-number v-model="form.辅助时间s" :min="0" :precision="2" :step="1" controls-position="right" style="width: 100%;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="总时间s" prop="总时间s">
<el-input-number v-model="form.总时间s" :min="0" :precision="2" :step="1" controls-position="right" style="width: 100%;" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="8">
<el-form-item label="单装数量(件)" prop="单装数量(件)">
<el-input-number v-model="form['单装数量(件)']" :min="0" :precision="2" :step="1" controls-position="right" style="width: 100%;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="操作台数" prop="操作台数">
<el-input-number v-model="form.操作台数" :min="0" :precision="2" :step="1" controls-position="right" style="width: 100%;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="日产能(件)" prop="日产能(件)">
<el-input-number v-model="form['日产能(件)']" :min="0" :precision="2" :step="1" controls-position="right" style="width: 100%;" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="最终单价" prop="最终单价(元/件)">
<!-- 修改人:Ld 修改时间:2026-07-06 09:23:45; 最终单价输入框仅保留两位小数显示 -->
<el-input-number v-model="form['最终单价(元/件)']" :min="0" :precision="2" :step="0.1" controls-position="right" style="width: 100%;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="生效日期" prop="生效日期">
<el-date-picker v-model="form.生效日期" type="date" value-format="yyyy-MM-dd" format="yyyy-MM-dd" clearable size="small" placeholder="选择生效日期" style="width: 100%;" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="变更次数" prop="变更次数">
<el-input-number v-model="form.变更次数" :min="0" :precision="0" :step="1" controls-position="right" style="width: 100%;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="启用状态" prop="是否启用">
<el-select v-model="form.是否启用" clearable filterable size="small" style="width: 100%;" placeholder="请选择启用状态">
<el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="24">
<el-form-item label="备注" prop="备注">
<el-input v-model="form.备注" :rows="3" type="textarea" clearable maxlength="200" show-word-limit />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="closeDialog()"> </el-button>
<el-button type="primary" @click="submitForm()"> </el-button>
</div>
</el-dialog>
<!-- 修改人:Ld 修改时间:2026-07-06 08:45:45 -->
<!-- 工序工价拷贝弹窗仅保留零件名称工序号和工艺名称预览 -->
<el-dialog v-el-drag-dialog :visible.sync="copyVisible" title="工序工价拷贝" center width="760px">
<el-row style="margin-bottom: 10px">
<el-input v-model="copyForm.零件筛选" clearable placeholder="零件图号或零件名称筛选" size="small" style="width: 260px">
<el-button slot="append" icon="el-icon-right" @click="searchCopyParts()" />
</el-input>
<el-select v-model="copyForm.源零件图号" clearable filterable size="small" style="width: 260px;margin-left: 10px" placeholder="源零件" @change="searchCopyProcess()">
<el-option v-for="item in copyPartList" :key="item.value" :label="item.label" :value="item.value">
<span style="float: left">{{ item.label }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</span>
</el-option>
</el-select>
</el-row>
<el-table :data="copyProcessList" border highlight-current-row stripe size="mini" height="420" style="width: 100%;">
<el-table-column type="index" label="序号" align="center" width="60" />
<el-table-column label="零件名称" align="center" show-overflow-tooltip min-width="180">
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="工序号" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.工序顺序 }}
</template>
</el-table-column>
<el-table-column label="工艺名称" align="center" show-overflow-tooltip min-width="180">
<template slot-scope="scope">
{{ scope.row.工艺名称 }}
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="copyVisible = false">取消</el-button>
<el-button type="primary" size="small" @click="submitCopy()">确定</el-button>
</div>
</el-dialog>
<!-- 修改人:Ld 修改时间:2026-07-02 15:33:23 -->
<!-- 历史定价弹窗 -->
<el-dialog v-el-drag-dialog :visible.sync="historyVisible" title="历史定价" center width="980px">
<el-table :data="historyData" border stripe size="mini" height="420" style="width: 100%;">
<el-table-column type="index" label="序号" align="center" width="60" />
<el-table-column label="工价流水号" align="center" width="110">
<template slot-scope="scope">
{{ scope.row.工价流水号 }}
</template>
</el-table-column>
<el-table-column label="操作类型" align="center" width="90">
<template slot-scope="scope">
{{ scope.row.操作类型 }}
</template>
</el-table-column>
<el-table-column label="工艺名称" align="center" show-overflow-tooltip width="120">
<template slot-scope="scope">
{{ scope.row.工艺名称 }}
</template>
</el-table-column>
<el-table-column label="工序名称" align="center" show-overflow-tooltip width="150">
<template slot-scope="scope">
{{ scope.row.工序名称 }}
</template>
</el-table-column>
<el-table-column label="变更前" align="center" show-overflow-tooltip min-width="150">
<template slot-scope="scope">
{{ scope.row.变更前 }}
</template>
</el-table-column>
<el-table-column label="变更后" align="center" show-overflow-tooltip min-width="150">
<template slot-scope="scope">
{{ scope.row.变更后 }}
</template>
</el-table-column>
<el-table-column label="操作人" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.操作人 }}
</template>
</el-table-column>
<el-table-column label="操作时间" align="center" width="140">
<template slot-scope="scope">
{{ scope.row.操作时间 }}
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="historyVisible = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
// 修改人:Ld 修改时间:2026-07-06 08:36:02
// 查询条件参考制定工艺组件,表格显示字段保持不变
queryForm: {
订单流水号: '',
组件流水号: '',
工艺计划流水号: '',
工序名称: '',
是否启用: ''
},
// 修改人:Ld 修改时间:2026-07-06 08:36:02
// 制定工艺查询入口下拉数据
orderNumberType: [],
productName: [],
partName: [],
// 修改人:Ld 修改时间:2026-07-02 15:33:23
// 下拉选项
statusOptions: [
{ label: '启用', value: 1 },
{ label: '停用', value: 0 }
],
// 修改人:Ld 修改时间:2026-07-02 15:33:23
// 表格与分页
loading: false,
tableData: [],
historyData: [],
total: 0,
pageCurrent: 1,
pageSize: 100,
// 修改人:Ld 修改时间:2026-07-02 15:33:23
// 弹窗状态
dialogFormVisible: false,
dialogTitle: '设置工序工价',
dialogMode: 'edit',
historyVisible: false,
// 修改人:Ld 修改时间:2026-07-06 08:45:45
// 工序工价拷贝数据,参考制定工艺拷贝但去掉工艺编辑功能
copyVisible: false,
copyForm: {
零件筛选: '',
源零件图号: ''
},
copyPartList: [],
copyProcessList: [],
// 修改人:Ld 修改时间:2026-07-02 15:33:23
// 表单主键
form: {
工价流水号: '',
工艺名称: '',
工序名称: '',
零件名称: '',
图号: '',
机动时间s: 0,
辅助时间s: 0,
总时间s: 0,
'单装数量(件)': 0,
操作台数: 0,
'日产能(件)': 0,
'最终单价(元/件)': 0,
生效日期: '',
变更次数: 0,
是否启用: 1,
备注: '',
工序流水号: ''
},
rules: {
工艺名称: [{ required: true, message: '请输入工艺名称', trigger: 'blur' }],
工序名称: [{ required: true, message: '请输入工序名称', trigger: 'blur' }],
零件名称: [{ required: true, message: '请输入零件名称', trigger: 'blur' }],
图号: [{ required: true, message: '请输入图号', trigger: 'blur' }],
是否启用: [{ required: true, message: '请选择启用状态', trigger: 'change' }]
}
}
},
created() {
this.getOrderNumberType()
this.searchTable()
},
methods: {
// 修改人:Ld 修改时间:2026-07-06 08:36:02
// 获取制定工艺组件同源订单下拉
getOrderNumberType() {
this.orderNumberType = []
var param = []
var Data = this.CreateData('11', '精工车间_制定工艺_订单查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.orderNumberType.push({
label: response.data[i].订单号,
value: response.data[i].订单流水号
})
}
})
},
// 修改人:Ld 修改时间:2026-07-06 08:36:02
// 订单切换后按制定工艺组件口径加载产品
handleOrderChange() {
this.queryForm.组件流水号 = ''
this.queryForm.工艺计划流水号 = ''
this.productName = []
this.partName = []
this.getproductName()
this.pageCurrent = 1
this.searchTable()
},
// 修改人:Ld 修改时间:2026-07-06 08:36:02
// 获取制定工艺组件同源产品下拉
getproductName() {
if (!this.queryForm.订单流水号) {
return
}
var param = []
param[0] = ['订单流水号', this.queryForm.订单流水号]
var Data = this.CreateData('11', '订单信息_产品信息_查询数据', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.productName.push({
label: response.data[i].产品名称,
value: response.data[i].组件流水号
})
}
})
},
// 修改人:Ld 修改时间:2026-07-06 08:36:02
// 产品切换后按制定工艺组件口径加载零件
handleProductChange() {
this.queryForm.工艺计划流水号 = ''
this.partName = []
this.getpartName()
this.pageCurrent = 1
this.searchTable()
},
// 修改人:Ld 修改时间:2026-07-06 08:36:02
// 获取制定工艺组件同源零件下拉
getpartName() {
if (!this.queryForm.组件流水号) {
return
}
var param = []
param[0] = ['组件流水号', this.queryForm.组件流水号]
var Data = this.CreateData('11', '精工车间_制定工艺_零件名称_查询', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.partName.push({
label: response.data[i].零件名称,
name: response.data[i].零件图号,
value: response.data[i].工艺计划流水号
})
}
})
},
// 修改人:Ld 修改时间:2026-07-06 08:36:02
// 查询列表
searchTable() {
this.loading = true
var param = []
param[0] = ['订单流水号', this.queryForm.订单流水号]
param[1] = ['订单流水号_check', this.queryForm.订单流水号 ? 1 : 0]
param[2] = ['组件流水号', this.queryForm.组件流水号]
param[3] = ['组件流水号_check', this.queryForm.组件流水号 ? 1 : 0]
param[4] = ['工艺计划流水号', this.queryForm.工艺计划流水号]
param[5] = ['工艺计划流水号_check', this.queryForm.工艺计划流水号 ? 1 : 0]
param[6] = ['工序名称', this.queryForm.工序名称]
param[7] = ['工序名称_check', this.queryForm.工序名称 ? 1 : 0]
param[8] = ['工艺名称', this.queryForm.工序名称]
param[9] = ['工艺名称_check', this.queryForm.工序名称 ? 1 : 0]
param[10] = ['是否启用', this.queryForm.是否启用]
param[11] = ['是否启用_check', this.queryForm.是否启用 === '' || this.queryForm.是否启用 === null || typeof this.queryForm.是否启用 === 'undefined' ? 0 : 1]
var Data = this.CreateData('11', '车间生产管理工艺_工序工价_查询数据', param, this.pageSize, this.pageCurrent)
this.ExecDatabase(Data).then(response => {
this.tableData = response.data && response.data.rows ? response.data.rows : response.data
this.total = response.data && response.data.total ? response.data.total : (this.tableData ? this.tableData.length : 0)
this.loading = false
}).catch(() => {
this.loading = false
})
},
// 修改人:Ld 修改时间:2026-07-06 08:45:45
// 打开工序工价拷贝
openCopyDialog() {
if (!this.queryForm.工艺计划流水号) {
this.$message.warning('请先选择要复制到的零件')
return
}
this.copyVisible = true
this.copyForm = {
零件筛选: '',
源零件图号: ''
}
this.copyPartList = []
this.copyProcessList = []
},
// 修改人:Ld 修改时间:2026-07-06 08:45:45
// 参考制定工艺拷贝的源零件查询
searchCopyParts() {
this.copyPartList = []
this.copyForm.源零件图号 = ''
this.copyProcessList = []
var param = []
param[0] = ['零件图号_check', this.copyForm.零件筛选 ? 1 : 0]
param[1] = ['零件图号', this.copyForm.零件筛选]
var Data = this.CreateData('11', '精工车间_制定工艺_零件名称_查询_工艺拷贝', param)
this.ExecDatabase(Data).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.copyPartList.push({
label: response.data[i].零件名称,
name: response.data[i].零件图号,
value: response.data[i].零件图号
})
}
})
},
// 修改人:Ld 修改时间:2026-07-06 08:45:45
// 源零件工序预览,仅显示零件名称、工序号和工艺名称
searchCopyProcess() {
this.copyProcessList = []
if (!this.copyForm.源零件图号) {
return
}
var param = []
param[0] = ['零件图号', this.copyForm.源零件图号]
var Data = this.CreateData('11', '车间生产管理工艺_工序工价_复制源_查询数据', param)
this.ExecDatabase(Data).then(response => {
this.copyProcessList = response.data
})
},
// 修改人:Ld 修改时间:2026-07-06 08:45:45
// 将源零件已维护的工价按工序号和工艺名称复制到当前零件
submitCopy() {
if (!this.queryForm.工艺计划流水号) {
this.$message.warning('请先选择要复制到的零件')
return
}
if (!this.copyForm.源零件图号 || this.copyProcessList.length === 0) {
this.$message.warning('请先选择源零件')
return
}
var param = []
param[0] = ['目标工艺计划流水号', this.queryForm.工艺计划流水号]
param[1] = ['源零件图号', this.copyForm.源零件图号]
var Data = this.CreateData('12', '车间生产管理工艺_工序工价_复制数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data && response.data[0] && response.data[0].result === '1') {
this.$message.success('拷贝成功')
this.copyVisible = false
this.searchTable()
} else {
this.$message.error(response.data && response.data[0] && response.data[0].message ? response.data[0].message : '拷贝失败')
}
})
},
// 修改人:Ld 修改时间:2026-07-02 15:33:23
// 打开编辑
openEditDialog(row) {
this.dialogMode = 'edit'
this.dialogTitle = '设置工序工价'
this.dialogFormVisible = true
this.form = {
工价流水号: row.工价流水号,
工艺名称: row.工艺名称,
工序名称: row.工序名称,
零件名称: row.零件名称,
图号: row.图号,
机动时间s: Number(row.机动时间s || 0),
辅助时间s: Number(row.辅助时间s || 0),
总时间s: Number(row.总时间s || 0),
'单装数量(件)': Number(row['单装数量(件)'] || 0),
操作台数: Number(row.操作台数 || 0),
'日产能(件)': Number(row['日产能(件)'] || 0),
'最终单价(元/件)': Number(row['最终单价(元/件)'] || 0),
生效日期: row.生效日期,
变更次数: Number(row.变更次数 || 0),
是否启用: row.是否启用 === '' || row.是否启用 === null || typeof row.是否启用 === 'undefined' ? 1 : Number(row.是否启用),
备注: row.备注,
工序流水号: row.工序流水号
}
},
// 修改人:Ld 修改时间:2026-07-02 15:33:23
// 提交新增或编辑
submitForm() {
this.$refs['form'].validate((valid) => {
if (!valid) {
return false
}
var param = []
param[0] = ['工价流水号', this.form.工价流水号]
param[1] = ['工艺名称', this.form.工艺名称]
param[2] = ['工序名称', this.form.工序名称]
param[3] = ['零件名称', this.form.零件名称]
param[4] = ['图号', this.form.图号]
param[5] = ['机动时间s', this.form.机动时间s]
param[6] = ['辅助时间s', this.form.辅助时间s]
param[7] = ['总时间s', this.form.总时间s]
// 修改人:Ld 修改时间:2026-07-03 08:02:29
// 带括号字段提交给存储过程时使用安全参数名,查询返回仍保持原字段名
param[8] = ['单装数量件', this.form['单装数量(件)']]
param[9] = ['操作台数', this.form.操作台数]
param[10] = ['日产能件', this.form['日产能(件)']]
param[11] = ['最终单价元件', this.form['最终单价(元/件)']]
param[12] = ['生效日期', this.form.生效日期]
param[13] = ['变更次数', this.form.变更次数]
param[14] = ['是否启用', this.form.是否启用]
param[15] = ['备注', this.form.备注]
param[16] = ['工序流水号', this.form.工序流水号]
var Data = this.CreateData('12', '车间生产管理工艺_工序工价_编辑数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data && response.data[0] && response.data[0].result === '1') {
this.$message.success('设置成功')
this.dialogFormVisible = false
this.searchTable()
} else {
this.$message.error('设置失败')
}
})
})
},
// 修改人:Ld 修改时间:2026-07-02 15:33:23
// 重置表单
resetForm() {
if (this.$refs['form'] !== undefined) {
this.$refs['form'].resetFields()
}
this.form = {
工价流水号: '',
工艺名称: '',
工序名称: '',
零件名称: '',
图号: '',
机动时间s: 0,
辅助时间s: 0,
总时间s: 0,
'单装数量(件)': 0,
操作台数: 0,
'日产能(件)': 0,
'最终单价(元/件)': 0,
生效日期: '',
变更次数: 0,
是否启用: 1,
备注: '',
工序流水号: ''
}
},
// 修改人:Ld 修改时间:2026-07-02 15:33:23
// 关闭弹窗
closeDialog() {
this.dialogFormVisible = false
this.resetForm()
},
// 修改人:Ld 修改时间:2026-07-02 15:33:23
// 停用工价
handleDisable(row) {
this.$confirm('确定停用该工序工价吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var param = []
param[0] = ['工价流水号', row.工价流水号]
var Data = this.CreateData('12', '车间生产管理工艺_工序工价_删除数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data && response.data[0] && response.data[0].result === '1') {
this.$message.success('停用成功')
this.searchTable()
} else {
this.$message.error('停用失败')
}
})
})
},
// 修改人:Ld 修改时间:2026-07-06 09:00:29
// 打开该零件该工序名称的历史定价
openHistoryDialog(row) {
this.historyVisible = true
var param = []
param[0] = ['零件名称_check', row.零件名称 ? 1 : 0]
param[1] = ['零件名称', row.零件名称]
param[2] = ['图号_check', row.图号 ? 1 : 0]
param[3] = ['图号', row.图号]
param[4] = ['工序名称_check', row.工序名称 ? 1 : 0]
param[5] = ['工序名称', row.工序名称]
var Data = this.CreateData('11', '车间生产管理工艺_工序工价_历史_查询数据', param)
this.ExecDatabase(Data).then(response => {
this.historyData = response.data
})
},
// 修改人:Ld 修改时间:2026-07-02 15:33:23
// 分页条数变化
handleSizeChange(val) {
this.pageCurrent = 1
this.pageSize = val
this.searchTable()
},
// 修改人:Ld 修改时间:2026-07-02 15:33:23
// 页码变化
handleCurrentChange(val) {
this.pageCurrent = val
this.searchTable()
}
}
}
</script>
<style scoped>
.toolbar {
display: flex;
flex-wrap: wrap;
gap: 10px;
align-items: center;
padding: 10px 0 12px;
}
.el-card {
padding: 0;
}
</style>