更新设备维修、发货、精工车间工序工价/生产审核/工时统计、仓储盘点/库存查询/库位/入库,新增车间派工移动端及SQL脚本

This commit is contained in:
Developer
2026-07-17 09:49:34 +08:00
parent 9c1f52078d
commit 2b9058c69c
20 changed files with 3326 additions and 343 deletions

View File

@@ -20,8 +20,12 @@
<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-input v-model="queryForm.零件名称" clearable size="small" style="width: 150px" placeholder="零件名称" @keyup.enter.native="pageCurrent = 1;searchTable()" />
<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.工艺计划流水号 || tableData.length === 0" icon="el-icon-collection" type="success" plain size="small" @click="handleSaveSource()">保存</el-button>
<el-button :disabled="!queryForm.工艺计划流水号" icon="el-icon-document-copy" type="warning" plain size="small" @click="openCopyDialog()">拷贝</el-button>
<el-tag v-if="savedSourceInfo" size="small" type="success" style="margin-left: 6px" closable @close="savedSourceInfo = null">已保存: {{ savedSourceInfo.零件名称 }}</el-tag>
</div>
<!-- 修改人:Ld 修改时间:2026-07-02 15:33:23 -->
@@ -355,6 +359,7 @@
</template>
<script>
import { mapGetters } from 'vuex'
export default {
data() {
return {
@@ -365,6 +370,8 @@ export default {
组件流水号: '',
工艺计划流水号: '',
工序名称: '',
零件名称: '',
图号: '',
是否启用: ''
},
// 修改人:Ld 修改时间:2026-07-06 08:36:02
@@ -401,6 +408,13 @@ export default {
},
copyPartList: [],
copyProcessList: [],
// 保存的源零件信息(供拷贝时直接使用)
savedSourceInfo: null,
// 修改人:Ld 修改时间:2026-07-17 08:44:08; 从工时统计跳转时携带的查询条件,赋值后直接调用查询接口
jumpQuery订单号: '',
jumpDirectQuery: false,
// 跳转时是否需要自动级联选择
jumpAutoCascade: false,
// 修改人:Ld 修改时间:2026-07-02 15:33:23
// 表单主键
form: {
@@ -431,8 +445,26 @@ export default {
}
}
},
computed: {
...mapGetters([
'id'
])
},
created() {
// 修改人:Ld 修改时间:2026-07-17 08:44:08; 支持从工时统计跳转后按携带值直接查询工价
if (this.$route.query.订单号) {
this.jumpQuery订单号 = this.$route.query.订单号
}
if (this.$route.query.零件名称 || this.$route.query.图号 || this.$route.query.工序名称) {
this.queryForm.零件名称 = this.$route.query.零件名称 || ''
this.queryForm.图号 = this.$route.query.图号 || ''
this.queryForm.工序名称 = this.$route.query.工序名称 || ''
this.jumpDirectQuery = true
}
this.getOrderNumberType()
if (this.jumpDirectQuery) {
this.pageCurrent = 1
}
this.searchTable()
},
methods: {
@@ -449,6 +481,23 @@ export default {
value: response.data[i].订单流水号
})
}
// 修改人:Ld 修改时间:2026-07-17 08:44:08; 跳转携带明细条件时仅补充订单赋值并按当前条件查询,避免自动选中第一个零件覆盖查询条件
if (this.jumpQuery订单号) {
for (var j = 0; j < this.orderNumberType.length; j++) {
if (this.orderNumberType[j].label === this.jumpQuery订单号) {
this.queryForm.订单流水号 = this.orderNumberType[j].value
if (this.jumpDirectQuery) {
this.pageCurrent = 1
this.searchTable()
} else {
this.jumpAutoCascade = true
this.getproductName()
}
this.jumpQuery订单号 = ''
break
}
}
}
})
},
// 修改人:Ld 修改时间:2026-07-06 08:36:02
@@ -468,6 +517,7 @@ export default {
if (!this.queryForm.订单流水号) {
return
}
this.productName = []
var param = []
param[0] = ['订单流水号', this.queryForm.订单流水号]
var Data = this.CreateData('11', '订单信息_产品信息_查询数据', param)
@@ -478,6 +528,11 @@ export default {
value: response.data[i].组件流水号
})
}
// 修改人:Ld 修改时间:2026-07-09; 跳转时自动选中第一个产品
if (this.jumpAutoCascade && this.productName.length > 0) {
this.queryForm.组件流水号 = this.productName[0].value
this.getpartName()
}
})
},
// 修改人:Ld 修改时间:2026-07-06 08:36:02
@@ -495,6 +550,7 @@ export default {
if (!this.queryForm.组件流水号) {
return
}
this.partName = []
var param = []
param[0] = ['组件流水号', this.queryForm.组件流水号]
var Data = this.CreateData('11', '精工车间_制定工艺_零件名称_查询', param)
@@ -506,6 +562,13 @@ export default {
value: response.data[i].工艺计划流水号
})
}
// 修改人:Ld 修改时间:2026-07-09; 跳转时自动选中第一个零件并查询
if (this.jumpAutoCascade && this.partName.length > 0) {
this.queryForm.工艺计划流水号 = this.partName[0].value
this.jumpAutoCascade = false
this.pageCurrent = 1
this.searchTable()
}
})
},
// 修改人:Ld 修改时间:2026-07-06 08:36:02
@@ -525,6 +588,11 @@ export default {
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]
param[12] = ['零件名称', this.queryForm.零件名称]
param[13] = ['零件名称_check', this.queryForm.零件名称 ? 1 : 0]
// 修改人:Ld 修改时间:2026-07-17 08:44:08; 工时统计跳转后按图号精确查询,避免同名零件匹配过宽
param[14] = ['图号', this.queryForm.图号]
param[15] = ['图号_check', this.queryForm.图号 ? 1 : 0]
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
@@ -534,13 +602,62 @@ export default {
this.loading = false
})
},
// 修改人:Ld 修改时间:2026-07-06 08:45:45
// 打开工序工价拷贝
// 修改人:Ld 修改时间:2026-07-08; 保存当前零件的工价信息,供拷贝时直接使用
handleSaveSource() {
if (!this.queryForm.工艺计划流水号 || !this.tableData || this.tableData.length === 0) {
this.$message.warning('当前没有可保存的零件数据')
return
}
var firstRow = this.tableData[0]
this.savedSourceInfo = {
图号: firstRow.图号 || '',
零件名称: firstRow.零件名称 || '',
工艺计划流水号: this.queryForm.工艺计划流水号
}
this.$message.success('已保存「' + this.savedSourceInfo.零件名称 + '」的工价数据')
},
// 修改人:Ld 修改时间:2026-07-08; 打开工序工价拷贝(优先使用已保存数据)
openCopyDialog() {
if (!this.queryForm.工艺计划流水号) {
this.$message.warning('请先选择要复制到的零件')
return
}
if (this.savedSourceInfo && this.savedSourceInfo.图号) {
this.$confirm(
'检测到已保存的工价数据(来源零件:' + this.savedSourceInfo.零件名称 + '),是否直接使用?',
'拷贝方式',
{ confirmButtonText: '使用已保存数据', cancelButtonText: '选择其他零件', type: 'info' }
).then(function() {
this.submitCopyFromSaved()
}.bind(this)).catch(function() {
this.openSourcePartDialog()
}.bind(this))
} else {
this.openSourcePartDialog()
}
},
// 修改人:Ld 修改时间:2026-07-08; 使用已保存的源零件信息直接调用后端复制
submitCopyFromSaved() {
if (!this.savedSourceInfo || !this.savedSourceInfo.图号) {
this.$message.warning('没有已保存的源零件数据')
return
}
var param = []
param[0] = ['目标工艺计划流水号', this.queryForm.工艺计划流水号]
param[1] = ['源零件图号', this.savedSourceInfo.图号]
param[2] = ['修改人', this.id]
var Data = this.CreateData('12', '车间生产管理工艺_工序工价_复制数据', param)
this.ExecDatabase(Data).then(function(response) {
if (response.data && response.data[0] && response.data[0].result === '1') {
this.$message.success('拷贝成功')
this.searchTable()
} else {
this.$message.error(response.data && response.data[0] && response.data[0].message ? response.data[0].message : '拷贝失败')
}
}.bind(this))
},
// 修改人:Ld 修改时间:2026-07-08; 打开源零件选择弹窗(原 openCopyDialog 逻辑)
openSourcePartDialog() {
this.copyVisible = true
this.copyForm = {
零件筛选: '',
@@ -597,6 +714,7 @@ export default {
var param = []
param[0] = ['目标工艺计划流水号', this.queryForm.工艺计划流水号]
param[1] = ['源零件图号', this.copyForm.源零件图号]
param[2] = ['修改人', this.id]
var Data = this.CreateData('12', '车间生产管理工艺_工序工价_复制数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data && response.data[0] && response.data[0].result === '1') {
@@ -661,6 +779,7 @@ export default {
param[14] = ['是否启用', this.form.是否启用]
param[15] = ['备注', this.form.备注]
param[16] = ['工序流水号', this.form.工序流水号]
param[17] = ['修改人', this.id]
var Data = this.CreateData('12', '车间生产管理工艺_工序工价_编辑数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data && response.data[0] && response.data[0].result === '1') {
@@ -715,6 +834,7 @@ export default {
}).then(() => {
var param = []
param[0] = ['工价流水号', row.工价流水号]
param[1] = ['修改人', this.id]
var Data = this.CreateData('12', '车间生产管理工艺_工序工价_删除数据', param)
this.ExecDatabase(Data).then(response => {
if (response.data && response.data[0] && response.data[0].result === '1') {