更新设备维修、发货、精工车间工序工价/生产审核/工时统计、仓储盘点/库存查询/库位/入库,新增车间派工移动端及SQL脚本
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
<div style="margin-top: 7px; margin-bottom: 7px">
|
||||
<el-input v-model="equipmentNo" placeholder="设备号" size="small" clearable style="width:160px" />
|
||||
<el-input v-model="equipmentName" placeholder="设备名" size="small" clearable style="width:160px;margin-left: 10px" />
|
||||
<!-- 添加报备人查询 修改人:Ld 修改时间:2026-07-06 14:12:26; -->
|
||||
<el-input v-model="reporter" placeholder="报备人" size="small" clearable style="width:160px;margin-left: 10px" />
|
||||
<span style="font-size: 13px;color: black;margin-left: 10px">整修时间</span>
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
@@ -25,6 +27,21 @@
|
||||
<el-table-column label="结束时间" prop="整修结束时间" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="工时" prop="工时" align="center" show-overflow-tooltip />
|
||||
<el-table-column label="报备人" prop="操作者" align="center" show-overflow-tooltip />
|
||||
<!-- 添加补助金额字段 修改人:Ld 修改时间:2026-07-06 14:12:26; -->
|
||||
<el-table-column label="单时补助(元)" prop="单时补助" align="center" width="150px">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-model="scope.row.单时补助"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
:step="1"
|
||||
controls-position="right"
|
||||
size="mini"
|
||||
style="width:130px"
|
||||
@change="handleAllowanceChange(scope.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总金额(元)" prop="总金额" align="center" width="120px" show-overflow-tooltip />
|
||||
<el-table-column label="整修状态" prop="整修状态" align="center" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.整修状态 === 0 || scope.row.整修状态 === '0'">整修中</span>
|
||||
@@ -54,6 +71,7 @@ export default {
|
||||
return {
|
||||
equipmentNo: '',
|
||||
equipmentName: '',
|
||||
reporter: '',
|
||||
dateRange: '',
|
||||
tableData: [],
|
||||
total: 0,
|
||||
@@ -71,9 +89,16 @@ export default {
|
||||
param[1] = ['设备名', this.equipmentName]
|
||||
param[2] = ['开始时间', this.dateRange ? this.dateRange[0] : '']
|
||||
param[3] = ['结束时间', this.dateRange ? this.dateRange[1] : '']
|
||||
// 添加报备人查询参数 修改人:Ld 修改时间:2026-07-06 14:12:26;
|
||||
param[4] = ['报备人', this.reporter]
|
||||
var Data = this.CreateData('11', '设备管理_整修记录_查询', param, this.pageSize, this.pageCurrent)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.tableData = response.data.rows
|
||||
// 查询回填补助金额并按分钟工时换算总金额 修改人:Ld 修改时间:2026-07-06 14:12:26;
|
||||
this.tableData = response.data.rows.map(row => {
|
||||
row.单时补助 = Number(row.单时补助 || 0)
|
||||
row.总金额 = this.getTotalAmount(row)
|
||||
return row
|
||||
})
|
||||
this.total = response.data.total
|
||||
})
|
||||
},
|
||||
@@ -92,8 +117,31 @@ export default {
|
||||
param[1] = ['设备名', this.equipmentName]
|
||||
param[2] = ['开始时间', this.dateRange ? this.dateRange[0] : '']
|
||||
param[3] = ['结束时间', this.dateRange ? this.dateRange[1] : '']
|
||||
// 添加报备人导出查询参数 修改人:Ld 修改时间:2026-07-06 14:12:26;
|
||||
param[4] = ['报备人', this.reporter]
|
||||
var Data = this.CreateData('2001', '设备管理_整修记录_查询', param)
|
||||
this.exportExcel_NPOI(Data)
|
||||
},
|
||||
getTotalAmount(row) {
|
||||
// 工时单位为分钟,单时补助单位为元/时 修改人:Ld 修改时间:2026-07-06 14:12:26;
|
||||
var workMinutes = Number(row.工时 || 0)
|
||||
var allowance = Number(row.单时补助 || 0)
|
||||
return (workMinutes / 60 * allowance).toFixed(2)
|
||||
},
|
||||
handleAllowanceChange(row) {
|
||||
row.总金额 = this.getTotalAmount(row)
|
||||
var param = []
|
||||
param[0] = ['id', row.id]
|
||||
param[1] = ['单时补助', row.单时补助]
|
||||
param[2] = ['总金额', row.总金额]
|
||||
var Data = this.CreateData('12', '设备管理_整修记录_补助保存', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('保存成功')
|
||||
} else {
|
||||
this.$message.error('保存失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1153,15 +1153,18 @@ export default {
|
||||
this.totalAmount = response.data[0].总金额
|
||||
this.totalCount = 0
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
// 修改人:Ld 修改时间:2026-07-14 17:26:52; 打印数量以实际发量列输入框为准。
|
||||
var currentRow = this.tableData2.find(item => item.发货单明细流水号 === response.data[i].发货单明细流水号) || this.tableData2[i]
|
||||
var printNum = currentRow && currentRow.查询实际发量 !== '' && currentRow.查询实际发量 !== null && currentRow.查询实际发量 !== undefined ? currentRow.查询实际发量 : response.data[i].实际发量
|
||||
this.returns.push({
|
||||
序号: i + 1,
|
||||
产品名称: response.data[i].产品名称,
|
||||
单位: response.data[i].单位,
|
||||
销售单价: response.data[i].单价,
|
||||
辅助规格: response.data[i].产品详情,
|
||||
数量: response.data[i].实际发量
|
||||
数量: printNum
|
||||
})
|
||||
this.totalCount += response.data[i].实际发量
|
||||
this.totalCount += Number(printNum)
|
||||
}
|
||||
}).then(() => {
|
||||
this.exportTable()
|
||||
|
||||
@@ -1149,15 +1149,18 @@ export default {
|
||||
this.totalAmount = response.data[0].总金额
|
||||
this.totalCount = 0
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
// 修改人:Ld 修改时间:2026-07-14 17:26:52; 打印数量以实际发量列输入框为准。
|
||||
var currentRow = this.tableData2.find(item => item.发货单明细流水号 === response.data[i].发货单明细流水号) || this.tableData2[i]
|
||||
var printNum = currentRow && currentRow.查询实际发量 !== '' && currentRow.查询实际发量 !== null && currentRow.查询实际发量 !== undefined ? currentRow.查询实际发量 : response.data[i].实际发量
|
||||
this.returns.push({
|
||||
序号: i + 1,
|
||||
产品名称: response.data[i].产品名称,
|
||||
单位: response.data[i].单位,
|
||||
销售单价: response.data[i].单价,
|
||||
辅助规格: response.data[i].产品详情,
|
||||
数量: response.data[i].实际发量
|
||||
数量: printNum
|
||||
})
|
||||
this.totalCount += response.data[i].实际发量
|
||||
this.totalCount += Number(printNum)
|
||||
}
|
||||
}).then(() => {
|
||||
this.exportTable()
|
||||
|
||||
@@ -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') {
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
size="small"
|
||||
clearable>
|
||||
<el-option label="待审核" value="待审核"/>
|
||||
<el-option label="审核通过" value="审核通过"/>
|
||||
<el-option label="已审核" value="已审核"/>
|
||||
<el-option label="审核不通过" value="审核不通过"/>
|
||||
</el-select>
|
||||
<span class="date-label">提交时间</span>
|
||||
@@ -69,8 +69,27 @@
|
||||
<el-table-column label="工序" prop="工序" align="center" width="110" show-overflow-tooltip/>
|
||||
<el-table-column label="工作者" prop="工作者姓名" align="center" width="90" show-overflow-tooltip/>
|
||||
<el-table-column label="完成数量" prop="完成数量" align="center" width="90"/>
|
||||
<!-- 修改人:Ld 修改时间:2026-07-06 15:18:06; 生产审核选择计件或计时并传给工时统计 -->
|
||||
<el-table-column label="计价方式" prop="计价方式" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
v-if="scope.row.审核状态 === '待审核' && scope.row.审核类型 === '加工完成'"
|
||||
v-model="scope.row.计价方式"
|
||||
size="mini"
|
||||
style="width: 94px">
|
||||
<el-option label="计件" value="计件"/>
|
||||
<el-option label="计时" value="计时"/>
|
||||
</el-select>
|
||||
<span v-else>{{ scope.row.计价方式 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="投产数量" prop="投产数量" align="center" width="90"/>
|
||||
<el-table-column label="已完成数" prop="已完成数" align="center" width="90"/>
|
||||
<el-table-column label="工时M" align="center" width="85">
|
||||
<template slot-scope="scope">
|
||||
{{ calcWorkMinutes(scope.row.开始时间, scope.row.结束时间) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工位号" prop="工位号" align="center" width="120" show-overflow-tooltip/>
|
||||
<el-table-column label="工位设备名称" prop="工位设备名称" align="center" width="150" show-overflow-tooltip/>
|
||||
<el-table-column label="设备号" prop="设备号" align="center" width="120" show-overflow-tooltip/>
|
||||
@@ -132,7 +151,15 @@
|
||||
<el-dialog v-el-drag-dialog :visible.sync="editVisible" title="修改审核数据" width="420px">
|
||||
<el-form ref="editForm" :model="editForm" label-width="110px" size="small">
|
||||
<el-form-item v-if="editForm.审核类型 === '加工完成'" label="完成数量">
|
||||
<el-input-number v-model="editForm.完成数量" :min="1" :step="1" step-strictly style="width: 220px"/>
|
||||
<!-- 完成数量为 0 的审核记录允许通过;修改人:Ld 修改时间:2026-07-15 10:06:11; -->
|
||||
<el-input-number v-model="editForm.完成数量" :min="0" :step="1" step-strictly style="width: 220px"/>
|
||||
</el-form-item>
|
||||
<!-- 修改人:Ld 修改时间:2026-07-06 15:18:06; 加工完成审核时选择计件或计时 -->
|
||||
<el-form-item v-if="editForm.审核类型 === '加工完成'" label="计价方式">
|
||||
<el-radio-group v-model="editForm.计价方式" size="small">
|
||||
<el-radio-button label="计件"/>
|
||||
<el-radio-button label="计时"/>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="editForm.审核类型 === '加工完成'" label="加工开始时间">
|
||||
<el-date-picker
|
||||
@@ -171,7 +198,7 @@
|
||||
style="width: 220px"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="editForm.审核类型 === '结束整修'" label="整修方案">
|
||||
<el-input v-model="editForm.整修方案" type="textarea" :rows="3" style="width: 220px"/>
|
||||
<el-input v-model="editForm.整修方案" :rows="3" type="textarea" style="width: 220px"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@@ -202,6 +229,7 @@ export default {
|
||||
editForm: {
|
||||
审核类型: '',
|
||||
完成数量: 1,
|
||||
计价方式: '计件',
|
||||
加工开始时间: '',
|
||||
加工完成时间: '',
|
||||
整修开始时间: '',
|
||||
@@ -212,7 +240,8 @@ export default {
|
||||
操作者: '',
|
||||
审核类型: '',
|
||||
审核状态: '待审核'
|
||||
}
|
||||
},
|
||||
peopleList: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -230,9 +259,31 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.searchTable()
|
||||
this.getPeople()
|
||||
},
|
||||
methods: {
|
||||
// 生产完成审核查询 修改人:Ld 修改时间:2026-07-02 13:57:18;
|
||||
getPeople() {
|
||||
var param = []
|
||||
var Data = this.CreateData('11', '人员信息_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (var i = 0; i < response.data.length; i++) {
|
||||
this.peopleList.push({
|
||||
人员编号: response.data[i].人员编号,
|
||||
姓名: response.data[i].姓名
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getPersonName(id) {
|
||||
if (!id) return ''
|
||||
for (var i = 0; i < this.peopleList.length; i++) {
|
||||
if (String(this.peopleList[i].人员编号) === String(id)) {
|
||||
return this.peopleList[i].姓名
|
||||
}
|
||||
}
|
||||
return id
|
||||
},
|
||||
searchTable() {
|
||||
var dateRangeCheck = this.dateRange ? 1 : 0
|
||||
var param = []
|
||||
@@ -291,6 +342,9 @@ export default {
|
||||
{ label: '工作者姓名', value: row.工作者姓名 },
|
||||
{ label: '完成类型', value: row.完成类型 },
|
||||
{ label: '完成数量', value: row.完成数量 },
|
||||
{ label: '计价方式', value: row.计价方式 },
|
||||
{ label: '单件工价', value: row.单件工价 },
|
||||
{ label: '单时工价', value: row.单时工价 },
|
||||
{ label: '投产数量', value: row.投产数量 },
|
||||
{ label: '已完成数', value: row.已完成数 },
|
||||
{ label: '工序顺序', value: row.工序顺序 },
|
||||
@@ -309,7 +363,7 @@ export default {
|
||||
{ label: '开始时间', value: row.开始时间 },
|
||||
{ label: '结束时间', value: row.结束时间 },
|
||||
{ label: '提交时间', value: row.提交时间 },
|
||||
{ label: '审核人', value: row.审核人 },
|
||||
{ label: '审核人', value: this.getPersonName(row.审核人) },
|
||||
{ label: '审核时间', value: row.审核时间 },
|
||||
{ label: '整修方案', value: row.整修方案 },
|
||||
{ label: '备注', value: row.备注 },
|
||||
@@ -317,14 +371,14 @@ export default {
|
||||
]
|
||||
this.detailVisible = true
|
||||
},
|
||||
// 生产完成审核通过 修改人:Ld 修改时间:2026-07-02 13:57:18;
|
||||
// 生产完成普通通过只改审核表状态为已审核,不再触发生产完成数据修改。修改人:Ld 修改时间:2026-07-17 09:10:08;
|
||||
approveRow(row) {
|
||||
this.$confirm('确定审核通过该生产完成记录?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.submitAudit(row, '审核通过', '')
|
||||
this.submitAudit(row, '已审核', '')
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
@@ -337,7 +391,9 @@ export default {
|
||||
this.editRow = row
|
||||
this.editForm = {
|
||||
审核类型: row.审核类型,
|
||||
完成数量: row.完成数量 ? Number(row.完成数量) : 1,
|
||||
// 保留 0 完成数量,避免审核修改弹窗将 0 自动改成 1;修改人:Ld 修改时间:2026-07-15 10:06:11;
|
||||
完成数量: row.完成数量 === null || row.完成数量 === undefined || row.完成数量 === '' ? 1 : Number(row.完成数量),
|
||||
计价方式: row.计价方式 || '计件',
|
||||
加工开始时间: row.开始时间 || '',
|
||||
加工完成时间: row.结束时间 || '',
|
||||
整修开始时间: row.开始时间 || '',
|
||||
@@ -351,17 +407,19 @@ export default {
|
||||
return
|
||||
}
|
||||
if (this.editForm.审核类型 === '加工完成') {
|
||||
if (!this.editForm.完成数量 || Number(this.editForm.完成数量) <= 0 || Number(this.editForm.完成数量) % 1 !== 0) {
|
||||
this.$message.error('完成数量必须为大于 0 的整数')
|
||||
if (this.editForm.完成数量 === null || this.editForm.完成数量 === undefined || this.editForm.完成数量 === '' || Number(this.editForm.完成数量) < 0 || Number(this.editForm.完成数量) % 1 !== 0) {
|
||||
// 完成数量为 0 的审核记录允许通过;修改人:Ld 修改时间:2026-07-15 10:06:11;
|
||||
this.$message.error('完成数量必须为大于等于 0 的整数')
|
||||
return
|
||||
}
|
||||
this.submitAudit(this.editRow, '审核通过', '修改完成数量和加工完成时间后通过', {
|
||||
this.submitAudit(this.editRow, '已审核', '修改完成数量和加工完成时间后通过', {
|
||||
finishQuantity: Number(this.editForm.完成数量),
|
||||
priceType: this.editForm.计价方式,
|
||||
startTime: this.editForm.加工开始时间,
|
||||
finishTime: this.editForm.加工完成时间
|
||||
})
|
||||
} else if (this.editForm.审核类型 === '结束整修') {
|
||||
this.submitAudit(this.editRow, '审核通过', '修改整修开始和结束时间后通过', {
|
||||
this.submitAudit(this.editRow, '已审核', '修改整修开始和结束时间后通过', {
|
||||
repairStartTime: this.editForm.整修开始时间,
|
||||
repairEndTime: this.editForm.整修结束时间,
|
||||
repairPlan: this.editForm.整修方案
|
||||
@@ -376,9 +434,15 @@ export default {
|
||||
param[2] = ['审核人', this.id]
|
||||
param[3] = ['审核意见', opinion]
|
||||
if (editData && editData.finishQuantity !== undefined) {
|
||||
// 仅修改数量通过时传审核完成数量,普通通过沿用审核单原完成数量 修改人:Ld 修改时间:2026-07-02 15:04:16;
|
||||
// 仅修改数量通过时传审核完成数量,普通通过只改审核状态。修改人:Ld 修改时间:2026-07-17 09:10:08;
|
||||
param.push(['审核完成数量', editData.finishQuantity])
|
||||
}
|
||||
if (editData && editData.priceType) {
|
||||
// 生产审核选择计件或计时,传给后端写入完成过程供工时统计判断 修改人:Ld 修改时间:2026-07-06 15:18:06;
|
||||
param.push(['计价方式', editData.priceType])
|
||||
} else if (row.计价方式) {
|
||||
param.push(['计价方式', row.计价方式])
|
||||
}
|
||||
if (editData && editData.startTime) {
|
||||
// 加工完成审核可修正实际加工开始时间 修改人:Ld 修改时间:2026-07-06 08:11:25;
|
||||
param.push(['审核加工开始时间', editData.startTime])
|
||||
@@ -410,8 +474,17 @@ export default {
|
||||
this.$message.error('审核失败')
|
||||
})
|
||||
},
|
||||
// 修改人:Ld 修改时间:2026-07-09; 根据开始结束时间计算工时(分钟)
|
||||
calcWorkMinutes(startTime, endTime) {
|
||||
if (!startTime || !endTime) return ''
|
||||
var start = new Date(startTime)
|
||||
var end = new Date(endTime)
|
||||
if (isNaN(start.getTime()) || isNaN(end.getTime())) return ''
|
||||
var diff = (end.getTime() - start.getTime()) / 60000
|
||||
return diff > 0 ? Math.round(diff) : ''
|
||||
},
|
||||
getAuditStateType(state) {
|
||||
if (state === '审核通过') {
|
||||
if (state === '已审核') {
|
||||
return 'success'
|
||||
} else if (state === '审核不通过') {
|
||||
return 'danger'
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="searchTable"/>
|
||||
<el-button type="success" plain icon="el-icon-download" size="small" style="margin-left: 60px" @click="exportExcel()">导出</el-button>
|
||||
<el-input v-model="searchOperator" clearable size="small" style="width: 130px;margin-left: 10px" placeholder="操作者" @keyup.enter.native="filterOperator" @clear="filterOperator"/>
|
||||
<el-button type="success" plain icon="el-icon-download" size="small" style="margin-left: 60px" @click="exportExcel()">导出</el-button>
|
||||
</div>
|
||||
<!-- 修改人:Ld 修改时间:2026-07-06 09:12:38; 增加总价列后调整员工汇总表宽度 -->
|
||||
<el-col style="margin-left: 7px;width: 371px">
|
||||
@@ -27,7 +28,7 @@
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
ref="table"
|
||||
:data="tableData"
|
||||
:data="filteredTableData"
|
||||
highlight-current-row
|
||||
show-summary
|
||||
border
|
||||
@@ -109,53 +110,73 @@
|
||||
{{ scope.row.完成数 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 修改人:Ld 修改时间:2026-07-06 09:12:38; 员工明细显示工序工价组件维护的工价和按数量计算的总价 -->
|
||||
<el-table-column width="80px" label="工价" align="center" show-overflow-tooltip prop="工价">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工价 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="90px" label="总价" align="center" show-overflow-tooltip prop="总价">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.总价 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :width="setColumnWidth('加工工时M')" label="加工工时M" align="center" show-overflow-tooltip prop="加工时长">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.加工时长 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="90px" label="暂停时长" align="center" show-overflow-tooltip prop="暂停时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.暂停时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :width="setColumnWidth('日期时间')" label="开始加工时间" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.开始加工 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :width="setColumnWidth('日期时间')" label="完成时间" align="center" prop="完成时间" sortable="完成时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.结束加工 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备" align="center" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :width="setColumnWidth('订单编号')" label="订单编号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.订单编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品/部件" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.产品名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 修改人:Ld 修改时间:2026-07-06 15:18:06; 工价列改为单价,计时记录可编辑单时工价 -->
|
||||
<el-table-column width="80px" label="计价方式" align="center" show-overflow-tooltip prop="计价方式">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.计价方式 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="Number(token) === 2" width="100px" label="单价" align="center" show-overflow-tooltip prop="单价">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-if="scope.row.计价方式 === '计时'"
|
||||
v-model="scope.row.单价"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
:step="1"
|
||||
controls-position="right"
|
||||
size="mini"
|
||||
style="width: 92px"
|
||||
@change="changeTimePrice(scope.row, 'person')"/>
|
||||
<span v-else>{{ scope.row.单价 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="Number(token) === 2" width="90px" label="总价" align="center" show-overflow-tooltip prop="总价">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.总价 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :width="setColumnWidth('加工工时M')" label="加工工时M" align="center" show-overflow-tooltip prop="加工时长">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.加工时长 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="90px" label="暂停时长" align="center" show-overflow-tooltip prop="暂停时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.暂停时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :width="setColumnWidth('日期时间')" label="开始加工时间" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.开始加工 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :width="setColumnWidth('日期时间')" label="完成时间" align="center" prop="完成时间" sortable="完成时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.结束加工 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备" align="center" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :width="setColumnWidth('订单编号')" label="订单编号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.订单编号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品/部件" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.产品名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="80px" label="操作" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" icon="el-icon-setting" @click="jumpToProcessPrice(scope.row)">工价</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- </el-card>-->
|
||||
</el-col>
|
||||
@@ -268,18 +289,33 @@
|
||||
{{ scope.row.完成数 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 修改人:Ld 修改时间:2026-07-06 09:12:38; 设备明细显示工序工价组件维护的工价和按数量计算的总价 -->
|
||||
<el-table-column width="80px" label="工价" align="center" show-overflow-tooltip prop="工价">
|
||||
<!-- 修改人:Ld 修改时间:2026-07-06 15:18:06; 工价列改为单价,计时记录可编辑单时工价 -->
|
||||
<el-table-column width="80px" label="计价方式" align="center" show-overflow-tooltip prop="计价方式">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工价 }}
|
||||
{{ scope.row.计价方式 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="90px" label="总价" align="center" show-overflow-tooltip prop="总价">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.总价 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :width="setColumnWidth('加工工时M')" label="加工工时M" align="center" show-overflow-tooltip prop="加工时长">
|
||||
<el-table-column v-if="Number(token) === 2" width="100px" label="单价" align="center" show-overflow-tooltip prop="单价">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-if="scope.row.计价方式 === '计时'"
|
||||
v-model="scope.row.单价"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
:step="1"
|
||||
controls-position="right"
|
||||
size="mini"
|
||||
style="width: 92px"
|
||||
@change="changeTimePrice(scope.row, 'device')"/>
|
||||
<span v-else>{{ scope.row.单价 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="Number(token) === 2" width="90px" label="总价" align="center" show-overflow-tooltip prop="总价">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.总价 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :width="setColumnWidth('加工工时M')" label="加工工时M" align="center" show-overflow-tooltip prop="加工时长">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.加工时长 }}
|
||||
</template>
|
||||
@@ -314,6 +350,11 @@
|
||||
{{ scope.row.产品名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="80px" label="操作" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" icon="el-icon-setting" @click="jumpToProcessPrice(scope.row)">工价</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- </el-card>-->
|
||||
@@ -347,6 +388,7 @@ export default {
|
||||
}
|
||||
], // 合同状态数组
|
||||
loading: false, // 数据加载
|
||||
searchOperator: '', // 修改人:Ld 修改时间:2026-07-09; 操作者筛选
|
||||
total: 0, // 分页总数
|
||||
total1: 0, // 分页总数
|
||||
total2: 0, // 分页总数
|
||||
@@ -373,7 +415,15 @@ export default {
|
||||
...mapGetters([
|
||||
'id',
|
||||
'token'
|
||||
])
|
||||
]),
|
||||
// 修改人:Ld 修改时间:2026-07-09; 按操作者筛选左侧汇总表
|
||||
filteredTableData() {
|
||||
if (!this.searchOperator || !this.tableData) return this.tableData
|
||||
var keyword = this.searchOperator.trim()
|
||||
return this.tableData.filter(function(row) {
|
||||
return row.操作者 && row.操作者.indexOf(keyword) !== -1
|
||||
})
|
||||
}
|
||||
},
|
||||
updated() {
|
||||
this.$nextTick(() => {
|
||||
@@ -384,6 +434,26 @@ export default {
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 修改人:Ld 修改时间:2026-07-17 08:44:08; 跳转到工序工价页面时携带当前行订单、零件、图号和工序,目标页按赋值直接查询
|
||||
jumpToProcessPrice(row) {
|
||||
this.$router.push({
|
||||
path: '/SeikoWorkshop/ProcessPrice',
|
||||
query: {
|
||||
订单号: row.订单编号 || '',
|
||||
零件名称: row.零件名称 || '',
|
||||
图号: row.图号 || row.零件图号 || '',
|
||||
工序名称: row.工序 || row.工序名称 || ''
|
||||
}
|
||||
})
|
||||
},
|
||||
// 修改人:Ld 修改时间:2026-07-09; 操作者筛选后刷新表格布局
|
||||
filterOperator() {
|
||||
this.$nextTick(function() {
|
||||
if (this.$refs.table) {
|
||||
this.$refs.table.doLayout()
|
||||
}
|
||||
})
|
||||
},
|
||||
getData() {
|
||||
if (this.PartType === '员工工时统计') {
|
||||
this.searchTable()
|
||||
@@ -426,6 +496,63 @@ export default {
|
||||
this.tableData1 = response.data
|
||||
})
|
||||
},
|
||||
changeTimePrice(row, type) {
|
||||
if (!row.完成过程流水号) {
|
||||
this.$message.warning('缺少完成过程流水号,无法保存单时工价')
|
||||
return
|
||||
}
|
||||
var param = []
|
||||
param[0] = ['完成过程流水号', row.完成过程流水号]
|
||||
param[1] = ['单时工价', row.单价]
|
||||
// 计时单价保存到完成过程表,工时统计总价重新按加工时长计算 修改人:Ld 修改时间:2026-07-06 15:18:06;
|
||||
var Data = this.CreateData('12', '车间生产管理_工时统计_单时工价_修改数据', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0] && response.data[0].result === '1') {
|
||||
this.$message.success('单价已保存')
|
||||
if (type === 'device') {
|
||||
this.refreshDeviceDetail()
|
||||
} else {
|
||||
this.refreshPersonDetail()
|
||||
}
|
||||
} else {
|
||||
this.$message.error(response.data[0] && response.data[0].message ? response.data[0].message : '单价保存失败')
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$message.error('单价保存失败')
|
||||
})
|
||||
},
|
||||
refreshPersonDetail() {
|
||||
if (!this.rowNumber) {
|
||||
return
|
||||
}
|
||||
var param = []
|
||||
param[0] = ['操作者编号', this.rowNumber]
|
||||
param[1] = ['开始时间', this.dateRange[0]]
|
||||
param[2] = ['结束时间', this.dateRange[1]]
|
||||
param[3] = ['排序名称', this.orderName]
|
||||
param[4] = ['排序方式', this.order]
|
||||
var Data = this.CreateData('11', '精工车间_员工工时统计_详情_查询数据', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.tableData1 = response.data
|
||||
})
|
||||
this.searchTable()
|
||||
},
|
||||
refreshDeviceDetail() {
|
||||
if (!this.rowNumber1) {
|
||||
return
|
||||
}
|
||||
var param = []
|
||||
param[0] = ['设备', this.rowNumber1]
|
||||
param[1] = ['开始时间', this.dateRange[0]]
|
||||
param[2] = ['结束时间', this.dateRange[1]]
|
||||
param[3] = ['排序名称', this.orderName1]
|
||||
param[4] = ['排序方式', this.order1]
|
||||
var Data = this.CreateData('11', '精工车间_设备工时统计_详情_查询数据', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.tableData3 = response.data
|
||||
})
|
||||
this.searchTable2()
|
||||
},
|
||||
searchTable2() {
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateRange[0]]
|
||||
|
||||
945
src/views/SeikoWorkshop/WorkshopAssignmentMobile/index.vue
Normal file
945
src/views/SeikoWorkshop/WorkshopAssignmentMobile/index.vue
Normal file
@@ -0,0 +1,945 @@
|
||||
<template>
|
||||
<!-- 修改人:Ld 修改时间:2026-07-14 13:12:40; 新增车间派工移动端自适应组件。 -->
|
||||
<div class="app-container workshop-assignment-mobile">
|
||||
<div class="dispatch-shell">
|
||||
<section class="filter-panel">
|
||||
<div class="filter-grid">
|
||||
<el-select
|
||||
v-model="orderNameValue"
|
||||
:remote-method="getOrderName"
|
||||
placeholder="订单号"
|
||||
size="small"
|
||||
filterable
|
||||
clearable
|
||||
remote
|
||||
@change="pageCurrent = 1; getProductName(); searchTable()">
|
||||
<el-option
|
||||
v-for="item in orderName1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="productNameValue"
|
||||
placeholder="产品/部件"
|
||||
size="small"
|
||||
filterable
|
||||
clearable
|
||||
@change="pageCurrent = 1; searchTable()">
|
||||
<el-option
|
||||
v-for="item in productName"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-input
|
||||
v-model="partNameValue"
|
||||
size="small"
|
||||
clearable
|
||||
placeholder="名称或图号"
|
||||
@keyup.enter.native="pageCurrent = 1; searchTable()"/>
|
||||
<el-button icon="el-icon-search" type="primary" size="small" @click="pageCurrent = 1; searchTable()">查询</el-button>
|
||||
</div>
|
||||
<div class="quick-actions">
|
||||
<el-button
|
||||
:disabled="!processValue"
|
||||
:type="IsItUrgent === 1 ? 'info' : 'warning'"
|
||||
plain
|
||||
size="small"
|
||||
@click="IsItUrgent === 1 ? CancelUrgent() : Urgent()">
|
||||
{{ IsItUrgent === 1 ? '取消加急' : '加急' }}
|
||||
</el-button>
|
||||
<el-button :disabled="!partTool" type="success" plain size="small" @click="getNum()">图纸</el-button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="content-grid">
|
||||
<div class="part-panel">
|
||||
<div class="panel-title">
|
||||
<span>待派工零件</span>
|
||||
<small>{{ total }} 条</small>
|
||||
</div>
|
||||
<div v-loading="loading" class="part-list">
|
||||
<div
|
||||
v-for="item in tableData"
|
||||
:key="item.工艺计划流水号"
|
||||
:class="['part-card', selectedPart && selectedPart.工艺计划流水号 === item.工艺计划流水号 ? 'is-active' : '', Number(item.是否加急) === 1 ? 'is-urgent' : '']"
|
||||
@click="searchTable1(item)">
|
||||
<div class="part-card-head">
|
||||
<strong>{{ item.零件名称 || '未命名零件' }}</strong>
|
||||
<el-tag v-if="Number(item.是否加急) === 1" type="danger" size="mini">加急</el-tag>
|
||||
<el-tag v-else-if="Number(item.已分配) === 1" size="mini">已派</el-tag>
|
||||
</div>
|
||||
<div class="part-main">{{ item.零件图号 || '-' }}</div>
|
||||
<div class="part-meta">
|
||||
<span>订单 {{ item.订单号 || '-' }}</span>
|
||||
<span>数量 {{ item.数量 || 0 }}</span>
|
||||
<span>库存 {{ item.库存 || 0 }}</span>
|
||||
</div>
|
||||
<div class="part-meta">
|
||||
<span>{{ item.产品名称 || '-' }}</span>
|
||||
<span>期限 {{ formatDate(item.精工期限) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!loading && tableData.length === 0" class="empty-state">暂无待派工零件</div>
|
||||
</div>
|
||||
<el-pagination
|
||||
:current-page="pageCurrent"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
small
|
||||
layout="prev, pager, next"
|
||||
class="mobile-page"
|
||||
@current-change="handleCurrentChanges"/>
|
||||
</div>
|
||||
|
||||
<div class="task-panel">
|
||||
<div class="panel-title">
|
||||
<span>派工操作</span>
|
||||
<small>{{ selectedPart ? selectedPart.零件名称 : '请先选择零件' }}</small>
|
||||
</div>
|
||||
<div class="assignee-grid">
|
||||
<el-select v-model="peopleValue" placeholder="操作者" size="small" filterable clearable>
|
||||
<el-option
|
||||
v-for="item in people"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-select v-model="machineValue" placeholder="设备" size="small" filterable clearable>
|
||||
<el-option
|
||||
v-for="item in machine"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<el-tabs v-model="activeTab" stretch>
|
||||
<el-tab-pane label="可派工序" name="available">
|
||||
<div v-loading="loadingProcess" class="process-list">
|
||||
<div v-for="row in tableData2" :key="row.工序流水号" class="process-card">
|
||||
<div class="process-head">
|
||||
<span>{{ row.工序顺序 }}. {{ row.工序 }}</span>
|
||||
<el-button type="primary" size="mini" @click="XUANRU(row)">派工</el-button>
|
||||
</div>
|
||||
<div class="process-field">
|
||||
<label>分配数</label>
|
||||
<el-input-number
|
||||
v-model="row.分配数"
|
||||
:min="0"
|
||||
:max="row.最大分配数"
|
||||
size="small"
|
||||
controls-position="right"/>
|
||||
</div>
|
||||
<div class="date-grid">
|
||||
<el-date-picker
|
||||
v-model="row.计划开始日期"
|
||||
size="small"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
type="date"
|
||||
placeholder="计划开始"/>
|
||||
<el-date-picker
|
||||
v-model="row.计划完成日期"
|
||||
size="small"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
type="date"
|
||||
placeholder="计划完成"/>
|
||||
</div>
|
||||
<div class="part-meta">
|
||||
<span>已分配 {{ row.已分配数 || 0 }}</span>
|
||||
<span>投产 {{ row.数量 || 0 }}</span>
|
||||
<span>最大 {{ row.最大分配数 || 0 }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!loadingProcess && tableData2.length === 0" class="empty-state">暂无可派工序</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="已派工序" name="assigned">
|
||||
<div v-loading="loadingProcess" class="process-list">
|
||||
<div v-for="row in tableData1" :key="row.工艺任务流水号" class="process-card assigned-card">
|
||||
<div class="process-head">
|
||||
<span>{{ row.工序顺序 }}. {{ row.工序 }}</span>
|
||||
<el-button
|
||||
:disabled="Number(row.是否加工中) === 1 || Number(row.完成数) > 0 || Number(row.报废数量) > 0"
|
||||
type="danger"
|
||||
plain
|
||||
size="mini"
|
||||
@click="XUANCHU(row)">取消</el-button>
|
||||
</div>
|
||||
<div class="part-meta">
|
||||
<span>操作者 {{ row.姓名 || '-' }}</span>
|
||||
<span>设备 {{ row.设备 || '-' }}</span>
|
||||
</div>
|
||||
<div class="part-meta">
|
||||
<span>投产 {{ row.数量 || 0 }}</span>
|
||||
<span>完成 {{ row.完成数 || 0 }}</span>
|
||||
<span>报废 {{ row.报废数量 || 0 }}</span>
|
||||
</div>
|
||||
<div class="process-actions">
|
||||
<el-button
|
||||
:disabled="Number(row.是否加工中) === 1 || Number(row.完成数) === 0 || (Number(row.数量) - Number(row.完成数)) === 0 || row.姓名 === '外协'"
|
||||
type="text"
|
||||
size="mini"
|
||||
@click="editData(row)">修改投产数</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!loadingProcess && tableData1.length === 0" class="empty-state">暂无已派工序</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible" title="修改投产数" width="92%" class="mobile-dialog">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="82px">
|
||||
<el-form-item label="投产数" prop="投产数">
|
||||
<el-input-number
|
||||
v-model="form.投产数"
|
||||
:max="productionNum"
|
||||
:min="finishNum"
|
||||
:step="1"
|
||||
size="small"
|
||||
controls-position="right"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="small" @click="callOff()">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="submit()">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="dialogVisible" title="图纸文件" width="92%" class="mobile-dialog">
|
||||
<div v-for="file in hadFile" :key="file.id" class="file-row">
|
||||
<svg-icon :icon-class="getFileIcon(file.suffix)"/>
|
||||
<a :href="file.url" target="view_window">{{ file.name }}</a>
|
||||
</div>
|
||||
<div v-if="hadFile.length === 0" class="empty-state">暂无图纸文件</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import { MESDownloadFile, wsuri } from '@/utils/request'
|
||||
import request from '@/utils/request'
|
||||
|
||||
export default {
|
||||
name: 'WorkshopAssignmentMobile',
|
||||
data() {
|
||||
return {
|
||||
// 修改人:Ld 修改时间:2026-07-14 13:12:40; 移动端派工组件状态独立维护,避免影响桌面端页面。
|
||||
activeTab: 'available',
|
||||
orderNameValue: '',
|
||||
orderName1: [],
|
||||
productNameValue: '',
|
||||
productName: [],
|
||||
partNameValue: '',
|
||||
peopleValue: '',
|
||||
people: [],
|
||||
machineValue: '',
|
||||
machine: [],
|
||||
machineName: '',
|
||||
selectedPart: null,
|
||||
partTool: '',
|
||||
processValue: '',
|
||||
IsItUrgent: 0,
|
||||
tableData: [],
|
||||
tableData1: [],
|
||||
tableData2: [],
|
||||
total: 0,
|
||||
pageCurrent: 1,
|
||||
pageSize: 10,
|
||||
loading: false,
|
||||
loadingProcess: false,
|
||||
loadingSubmit: true,
|
||||
dialogVisible: false,
|
||||
dialogFormVisible: false,
|
||||
hadFile: [],
|
||||
productionNum: '',
|
||||
finishNum: '',
|
||||
proccessStateValue: '',
|
||||
processSequence: '',
|
||||
form: {
|
||||
投产数: ''
|
||||
},
|
||||
rules: {
|
||||
投产数: [{ required: true, message: '请输入投产数', trigger: 'blur' }]
|
||||
},
|
||||
websock: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'id'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
machineValue(val) {
|
||||
for (let i = 0; i < this.machine.length; i++) {
|
||||
if (val === this.machine[i].value) {
|
||||
this.machineName = this.machine[i].name
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getOrderName('')
|
||||
this.getMachine()
|
||||
this.getPeople()
|
||||
this.searchTable()
|
||||
this.initWebpack()
|
||||
},
|
||||
mounted() {
|
||||
// 修改人:Ld 修改时间:2026-07-14 14:33:59; 进入移动端派工页时标记页面,用于覆盖全局固定最小宽度。
|
||||
document.body.classList.add('workshop-assignment-mobile-page')
|
||||
},
|
||||
beforeDestroy() {
|
||||
document.body.classList.remove('workshop-assignment-mobile-page')
|
||||
if (this.websock) {
|
||||
this.websock.close()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initWebpack() {
|
||||
this.websock = new WebSocket(wsuri)
|
||||
this.websock.onopen = this.websocketopen
|
||||
this.websock.onclose = this.websocketclose
|
||||
this.websock.onerror = this.websocketerror
|
||||
},
|
||||
websocketopen() {
|
||||
console.log('WebSocket连接成功')
|
||||
},
|
||||
websocketclose() {
|
||||
console.log('WebSocket关闭')
|
||||
},
|
||||
websocketerror() {
|
||||
console.log('WebSocket连接失败')
|
||||
},
|
||||
sendRefreshWorkTasks(machineName) {
|
||||
if (this.websock && this.websock.readyState === 1 && machineName) {
|
||||
this.websock.send(`TOBS??${machineName}?MES|RefreshWorkTasks`)
|
||||
}
|
||||
},
|
||||
getOrderName(query) {
|
||||
this.orderName1 = []
|
||||
var param = []
|
||||
// 修改人:Ld 修改时间:2026-07-14 14:43:34; 订单号列表改用生产任务查询订单接口。
|
||||
var Data = this.CreateData('11', '生产任务查询_订单信息_列表_查询数据', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.orderName1.push({
|
||||
label: response.data[i].订单编号,
|
||||
value: response.data[i].订单流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getProductName() {
|
||||
this.productNameValue = ''
|
||||
this.productName = []
|
||||
if (this.orderNameValue) {
|
||||
var param = []
|
||||
param[0] = ['订单流水号', this.orderNameValue]
|
||||
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].组件流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getMachine() {
|
||||
var param = []
|
||||
var Data = this.CreateData('11', '设备信息_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.machine.push({
|
||||
label: response.data[i].设备名称 !== '外协' ? response.data[i].设备名称 + '_' + response.data[i].工位号 : response.data[i].设备名称,
|
||||
value: response.data[i].设备流水号,
|
||||
name: response.data[i].工位号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getPeople() {
|
||||
var param = []
|
||||
param[0] = ['考核部门编号', 19]
|
||||
var Data = this.CreateData('11', '人事档案管理_人员_部门与人员_派工_查询数据_根据部门编号', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.people.push({
|
||||
label: response.data[i].姓名,
|
||||
value: response.data[i].人员编号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchTable() {
|
||||
this.loading = true
|
||||
this.tableData1 = []
|
||||
this.tableData2 = []
|
||||
this.selectedPart = null
|
||||
this.partTool = ''
|
||||
this.processValue = ''
|
||||
let orderNameValue_check, productNameValue_check, partNameValue_check
|
||||
this.orderNameValue ? orderNameValue_check = 1 : orderNameValue_check = 0
|
||||
this.productNameValue ? productNameValue_check = 1 : productNameValue_check = 0
|
||||
this.partNameValue ? partNameValue_check = 1 : partNameValue_check = 0
|
||||
var param = []
|
||||
param[0] = ['订单流水号_check', orderNameValue_check]
|
||||
param[1] = ['订单流水号', this.orderNameValue]
|
||||
param[2] = ['组件流水号', this.productNameValue]
|
||||
param[3] = ['组件流水号_check', productNameValue_check]
|
||||
param[4] = ['零件名称_check', partNameValue_check]
|
||||
param[5] = ['零件名称', this.partNameValue]
|
||||
var Data = this.CreateData('11', '精工车间_车间派工_查询', param, this.pageSize, this.pageCurrent)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.tableData = response.data.rows || []
|
||||
this.total = response.data.total || 0
|
||||
this.loading = false
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
searchTable1(row) {
|
||||
this.selectedPart = row
|
||||
this.partTool = row.零件图号
|
||||
this.processValue = row.工艺计划流水号
|
||||
this.IsItUrgent = Number(row.是否加急)
|
||||
this.loadingProcess = true
|
||||
var param = []
|
||||
param[0] = ['工艺计划流水号', row.工艺计划流水号]
|
||||
var Data = this.CreateData('11', '车间生产管理工艺_零件工序_已派工查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.tableData1 = response.data || []
|
||||
var param1 = []
|
||||
param1[0] = ['工艺计划流水号', row.工艺计划流水号]
|
||||
var Data1 = this.CreateData('11', '车间生产管理工艺_零件工序_派工_工序查询', param1)
|
||||
this.ExecDatabase(Data1).then(response => {
|
||||
this.tableData2 = response.data || []
|
||||
this.copyPlanDate()
|
||||
this.loadingProcess = false
|
||||
}).catch(() => {
|
||||
this.loadingProcess = false
|
||||
})
|
||||
}).catch(() => {
|
||||
this.loadingProcess = false
|
||||
})
|
||||
},
|
||||
copyPlanDate() {
|
||||
for (let i = 0; i < this.tableData2.length; i++) {
|
||||
const item = this.tableData2[i]
|
||||
const table1Item = this.tableData1.find(t1 => t1.工序 === item.工序)
|
||||
if (table1Item) {
|
||||
item.计划开始日期 = table1Item.计划开始日期
|
||||
item.计划完成日期 = table1Item.Expr1
|
||||
}
|
||||
}
|
||||
},
|
||||
reloadProcess(row) {
|
||||
const target = row || this.selectedPart
|
||||
if (target) {
|
||||
this.searchTable1(target)
|
||||
}
|
||||
},
|
||||
refreshAfterOperate() {
|
||||
// 修改人:Ld 修改时间:2026-07-14 13:12:40; 操作后保留当前零件上下文,便于移动端连续派工。
|
||||
const target = this.selectedPart
|
||||
this.searchTable()
|
||||
if (target) {
|
||||
this.searchTable1(target)
|
||||
}
|
||||
},
|
||||
XUANRU(row) {
|
||||
if (!this.peopleValue) {
|
||||
this.$message.warning('操作者不能为空')
|
||||
return
|
||||
}
|
||||
if (!this.machineValue) {
|
||||
this.$message.warning('设备不能为空')
|
||||
return
|
||||
}
|
||||
if (Number(row.分配数) === 0) {
|
||||
this.$message.warning('分配数不能为0')
|
||||
return
|
||||
}
|
||||
if (this.loadingSubmit) {
|
||||
this.loadingSubmit = false
|
||||
var param = []
|
||||
param[0] = ['工序流水号', row.工序流水号]
|
||||
param[1] = ['数量', row.分配数]
|
||||
param[2] = ['人员编号', this.peopleValue]
|
||||
param[3] = ['设备流水号', this.machineValue]
|
||||
param[4] = ['调拨员编号', this.id]
|
||||
param[5] = ['计划完成日期', row.计划完成日期]
|
||||
param[6] = ['计划开始日期', row.计划开始日期]
|
||||
// 修改人:Ld 修改时间:2026-07-14 13:12:40; 保持派工参数与原桌面组件存储过程一致。
|
||||
var Data = this.CreateData('12', '车间生产管理工艺_零件工序_派工', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.loadingSubmit = true
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('派工成功')
|
||||
this.sendRefreshWorkTasks(this.machineName)
|
||||
this.refreshAfterOperate()
|
||||
} else {
|
||||
this.$message.error('派工失败')
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loadingSubmit = true
|
||||
})
|
||||
}
|
||||
},
|
||||
XUANCHU(row) {
|
||||
if (Number(row.完成数) === 0 && Number(row.是否加工中) === 0) {
|
||||
if (Number(row.报废数量) === 0) {
|
||||
var param = []
|
||||
param[0] = ['工序流水号', row.工序流水号]
|
||||
param[1] = ['数量', row.数量]
|
||||
param[2] = ['工艺任务流水号', row.工艺任务流水号]
|
||||
param[3] = ['退货人', this.id]
|
||||
param[4] = ['订单流水号', row.订单流水号]
|
||||
// 修改人:Ld 修改时间:2026-07-14 13:12:40; 移动端取消派工沿用原业务参数。
|
||||
var Data = this.CreateData('12', '车间生产管理工艺_零件工序_取消派工', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('取消成功')
|
||||
this.sendRefreshWorkTasks(row.工位号)
|
||||
this.refreshAfterOperate()
|
||||
} else {
|
||||
this.$message.error('取消失败')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.warning('零件存在质检记录!不能取消派工')
|
||||
}
|
||||
} else {
|
||||
this.$message.warning('零件已加工!不能取消派工')
|
||||
}
|
||||
},
|
||||
editData(row) {
|
||||
this.productionNum = row.数量
|
||||
this.form.投产数 = row.数量
|
||||
this.finishNum = row.完成数
|
||||
this.proccessStateValue = row.工艺任务流水号
|
||||
this.processSequence = row.工序顺序
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
submit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.productionNum === this.form.投产数) {
|
||||
this.$message.warning('数量未发生改变')
|
||||
return
|
||||
}
|
||||
var param = []
|
||||
param[0] = ['工艺任务流水号', this.proccessStateValue]
|
||||
param[1] = ['原数量', this.productionNum]
|
||||
param[2] = ['数量', this.form.投产数]
|
||||
param[3] = ['工序顺序', this.processSequence]
|
||||
var Data = this.CreateData('12', '车间生产管理工艺_零件工序_派工_修改数量', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('修改成功')
|
||||
this.dialogFormVisible = false
|
||||
this.reloadProcess()
|
||||
} else {
|
||||
this.$message.error('修改失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
callOff() {
|
||||
this.dialogFormVisible = false
|
||||
},
|
||||
Urgent() {
|
||||
if (this.processValue) {
|
||||
var param = []
|
||||
param[0] = ['工艺计划流水号', this.processValue]
|
||||
var Data = this.CreateData('12', '车间生产管理工艺_零件_加急', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('加急成功')
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('加急失败')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.warning('请选择要加急的零件')
|
||||
}
|
||||
},
|
||||
CancelUrgent() {
|
||||
if (this.processValue) {
|
||||
var param = []
|
||||
param[0] = ['工艺计划流水号', this.processValue]
|
||||
var Data = this.CreateData('12', '车间生产管理工艺_零件_取消加急', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('取消成功')
|
||||
this.searchTable()
|
||||
} else {
|
||||
this.$message.error('取消失败')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.warning('请选择要取消加急的零件')
|
||||
}
|
||||
},
|
||||
handleCurrentChanges(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchTable()
|
||||
},
|
||||
getNum() {
|
||||
if (this.partTool) {
|
||||
this.dialogVisible = true
|
||||
this.getFileList(this.partTool)
|
||||
} else {
|
||||
this.$message.warning('请先选择零件')
|
||||
}
|
||||
},
|
||||
getFileList(value) {
|
||||
value = value.replace('B1', '')
|
||||
this.hadFile = []
|
||||
if (value) {
|
||||
request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '3',
|
||||
name: `select * from 机加工MES_零件图PDF表 where 是否启用 = 1 and name = '${value}'`
|
||||
}
|
||||
}).then(data => {
|
||||
if (data.data.length > 0) {
|
||||
const server = `${MESDownloadFile}`.split('/')
|
||||
data.data.map(item => {
|
||||
this.hadFile.push({
|
||||
url: `http://${server[2]}/webpage/part/${item.uid}.${item.suffix}`,
|
||||
name: `${item.name}.${item.suffix}`,
|
||||
suffix: item.suffix,
|
||||
id: item.uid
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getFileIcon(suffix) {
|
||||
if (suffix === 'pdf') return 'pdf'
|
||||
if (suffix === 'docx' || suffix === 'doc') return 'doc'
|
||||
if (suffix === 'xlsx' || suffix === 'xls') return 'excel'
|
||||
if (suffix === 'pptx' || suffix === 'ppt') return 'ppt'
|
||||
if (suffix === 'jpg' || suffix === 'jpeg' || suffix === 'png') return 'pic'
|
||||
return 'file'
|
||||
},
|
||||
formatDate(value) {
|
||||
if (!value) return '-'
|
||||
return String(value).split(' ')[0]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 修改人:Ld 修改时间:2026-07-14 13:12:40; 新增派工移动端自适应样式。 */
|
||||
.workshop-assignment-mobile {
|
||||
/* 修改人:Ld 修改时间:2026-07-14 13:40:23; 修复移动端容器和内部控件固定最小宽度导致的横向溢出。 */
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
min-height: calc(100vh - 84px);
|
||||
padding: 10px;
|
||||
overflow-x: hidden;
|
||||
box-sizing: border-box;
|
||||
background: #f4f7fb;
|
||||
}
|
||||
|
||||
.dispatch-shell {
|
||||
width: 100%;
|
||||
max-width: none;
|
||||
margin: 0 auto;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.filter-panel,
|
||||
.part-panel,
|
||||
.task-panel {
|
||||
min-width: 0;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #d8e1ec;
|
||||
border-radius: 8px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.filter-panel {
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.filter-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.quick-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.content-grid {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
|
||||
gap: 10px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.part-panel,
|
||||
.task-panel {
|
||||
min-height: 640px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.panel-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 28px;
|
||||
margin-bottom: 8px;
|
||||
color: #1f2d3d;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.panel-title small {
|
||||
color: #6b778c;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.part-list,
|
||||
.process-list {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.part-list {
|
||||
max-height: calc(100vh - 226px);
|
||||
min-height: 420px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.process-list {
|
||||
max-height: calc(100vh - 236px);
|
||||
min-height: 450px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.part-card,
|
||||
.process-card {
|
||||
min-width: 0;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #dbe4ef;
|
||||
border-radius: 8px;
|
||||
padding: 10px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.part-card {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.part-card.is-active {
|
||||
border-color: #409eff;
|
||||
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.14);
|
||||
}
|
||||
|
||||
.part-card.is-urgent {
|
||||
border-left: 4px solid #f56c6c;
|
||||
}
|
||||
|
||||
.part-card-head,
|
||||
.process-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.part-card-head strong,
|
||||
.process-head span {
|
||||
overflow: hidden;
|
||||
color: #172b4d;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.part-main {
|
||||
margin: 6px 0;
|
||||
color: #303133;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.part-meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px 12px;
|
||||
min-width: 0;
|
||||
margin-top: 6px;
|
||||
color: #6b778c;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.assignee-grid,
|
||||
.date-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.process-field {
|
||||
display: grid;
|
||||
grid-template-columns: 56px minmax(0, 1fr);
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
margin: 10px 0 8px;
|
||||
color: #606266;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.process-actions {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.assigned-card {
|
||||
background: #fbfcfe;
|
||||
}
|
||||
|
||||
.mobile-page {
|
||||
margin-top: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.file-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
min-height: 36px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
}
|
||||
|
||||
.file-row a {
|
||||
color: #409eff;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.workshop-assignment-mobile >>> .el-select,
|
||||
.workshop-assignment-mobile >>> .el-date-editor.el-input,
|
||||
.workshop-assignment-mobile >>> .el-input-number,
|
||||
.workshop-assignment-mobile >>> .el-input,
|
||||
.workshop-assignment-mobile >>> .el-button {
|
||||
max-width: 100%;
|
||||
min-width: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.workshop-assignment-mobile >>> .el-select,
|
||||
.workshop-assignment-mobile >>> .el-date-editor.el-input,
|
||||
.workshop-assignment-mobile >>> .el-input-number,
|
||||
.workshop-assignment-mobile >>> .el-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.workshop-assignment-mobile >>> .el-input__inner {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 1080px) {
|
||||
.filter-grid {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.content-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.part-panel,
|
||||
.task-panel {
|
||||
min-height: auto;
|
||||
}
|
||||
|
||||
.part-list,
|
||||
.process-list {
|
||||
max-height: none;
|
||||
min-height: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.workshop-assignment-mobile {
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
.filter-grid,
|
||||
.content-grid,
|
||||
.assignee-grid,
|
||||
.date-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.part-panel,
|
||||
.task-panel {
|
||||
min-height: auto;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.part-list,
|
||||
.process-list {
|
||||
max-height: none;
|
||||
min-height: 0;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.quick-actions .el-button {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
/* 修改人:Ld 修改时间:2026-07-14 14:33:59; 仅在移动端派工页覆盖全局 main-container 的 1360px 最小宽度。 */
|
||||
body.workshop-assignment-mobile-page #app .main-container,
|
||||
body.workshop-assignment-mobile-page #app .app-main {
|
||||
max-width: 100% !important;
|
||||
min-width: 0 !important;
|
||||
overflow-x: hidden !important;
|
||||
}
|
||||
|
||||
body.workshop-assignment-mobile-page #app .app-main {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
body.workshop-assignment-mobile-page #app .mobile .main-container {
|
||||
width: 100vw !important;
|
||||
max-width: 100vw !important;
|
||||
min-width: 0 !important;
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
|
||||
body.workshop-assignment-mobile-page {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
</style>
|
||||
@@ -393,10 +393,38 @@ export default {
|
||||
}
|
||||
sendMessage = sendMessage + number + word
|
||||
this.websock.send(sendMessage)
|
||||
this.printSelected()
|
||||
} else {
|
||||
this.$message.warning('请选择要打印的物料')
|
||||
}
|
||||
},
|
||||
printSelected() {
|
||||
var list = this.multipleSelection
|
||||
var printHtml = '<!DOCTYPE html><html><head><meta charset="utf-8"><title>库存盘点打印</title>'
|
||||
printHtml += '<style>'
|
||||
printHtml += 'body { font-family: "Microsoft YaHei", sans-serif; margin: 10px; }'
|
||||
printHtml += 'table { width: 100%; border-collapse: collapse; }'
|
||||
printHtml += 'th, td { border: 1px solid #333; padding: 8px 12px; text-align: center; font-size: 14px; }'
|
||||
printHtml += 'th { background-color: #f0f0f0; font-weight: bold; }'
|
||||
printHtml += '@media print { @page { size: auto; margin: 10mm; } }'
|
||||
printHtml += '</style></head><body>'
|
||||
printHtml += '<h2 style="text-align:center;">库存盘点</h2>'
|
||||
printHtml += '<table><thead><tr><th>物料编码</th><th>物料名称</th><th>图号</th><th>库位</th></tr></thead><tbody>'
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
printHtml += '<tr>'
|
||||
printHtml += '<td>' + (list[i].物料编码 || '') + '</td>'
|
||||
printHtml += '<td>' + (list[i].物料名称 || '') + '</td>'
|
||||
printHtml += '<td>' + (list[i].图号或型号 || '') + '</td>'
|
||||
printHtml += '<td>' + (list[i].货位名称 || '') + '</td>'
|
||||
printHtml += '</tr>'
|
||||
}
|
||||
printHtml += '</tbody></table></body></html>'
|
||||
var printWindow = window.open('', '_blank')
|
||||
printWindow.document.write(printHtml)
|
||||
printWindow.document.close()
|
||||
printWindow.focus()
|
||||
printWindow.print()
|
||||
},
|
||||
getWord(number, name, val, location) {
|
||||
let word
|
||||
word = ''
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
@cell-click="handleEdit"
|
||||
@sort-change="sortChange"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="40" :reserve-selection="true" />
|
||||
<el-table-column :reserve-selection="true" type="selection" width="40" />
|
||||
<el-table-column type="expand" width="1">
|
||||
<template slot-scope="scope">
|
||||
<el-table
|
||||
@@ -93,7 +93,7 @@
|
||||
style="width:962px"
|
||||
height="258px"
|
||||
size="small">
|
||||
<el-table-column label="物料编码" align="center" prop="物料码"><!-- 备注:修改人:Ld 修改时间:2026-06-29 14:24:00 -->
|
||||
<el-table-column label="物料编码" align="center" prop="物料码"><!-- 备注:修改人:Ld 修改时间:2026-07-15 17:14:07; 展开行恢复原出入库记录数据。 -->
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料编码 }}
|
||||
</template>
|
||||
@@ -168,14 +168,23 @@
|
||||
{{ scope.row.图号或型号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :width="setColumnWidth('数量')" label="库位" sortable="库位" prop="库位" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.货位名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :width="setColumnWidth('数量')" label="库存" sortable="库存" prop="库存" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.库存 }}
|
||||
<el-popover
|
||||
placement="bottom"
|
||||
width="300"
|
||||
trigger="click"
|
||||
@show="getStockLocationDetail(scope.row)">
|
||||
<el-table v-loading="stockLocationLoading" :data="stockLocationData" border stripe size="mini" max-height="300">
|
||||
<el-table-column prop="货位名称" label="库位" align="center" show-overflow-tooltip/>
|
||||
<el-table-column prop="货位存量" label="数量" align="center">
|
||||
<template slot-scope="stockScope">
|
||||
{{ stockScope.row.货位存量 || stockScope.row.库存 || 0 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span slot="reference" style="cursor: pointer; color: #409EFF; text-decoration: underline;">{{ scope.row.库存 }}</span><!-- 备注:修改人:Ld 修改时间:2026-07-15 17:14:07; 库存库位明细改为参考需求数的小窗显示。 -->
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :width="setColumnWidth('数量')" label="需求数" align="center">
|
||||
@@ -185,7 +194,7 @@
|
||||
width="400"
|
||||
trigger="click"
|
||||
@show="getDemandDetail(scope.row)">
|
||||
<el-table :data="demandDetailData" border stripe size="mini" max-height="300" v-loading="demandDetailLoading">
|
||||
<el-table v-loading="demandDetailLoading" :data="demandDetailData" border stripe size="mini" max-height="300">
|
||||
<el-table-column prop="订单编号" label="订单号" align="center" show-overflow-tooltip/>
|
||||
<el-table-column prop="最终需求量" label="需求量" align="center"/>
|
||||
<el-table-column prop="简称" label="客户" align="center"/>
|
||||
@@ -404,7 +413,9 @@ export default {
|
||||
order: '', // 排序方式
|
||||
multipleSelection: [], // 选中的行
|
||||
demandDetailData: [],
|
||||
demandDetailLoading: false
|
||||
demandDetailLoading: false,
|
||||
stockLocationData: [],
|
||||
stockLocationLoading: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -465,18 +476,48 @@ export default {
|
||||
this.pageCurrent1 = val
|
||||
this.searchTable2()
|
||||
},
|
||||
getInventoryLocationRows(row) {
|
||||
var param = []
|
||||
var materialName_check = row.物料名称 ? 1 : 0
|
||||
var specificationsModel_check = row.图号或型号 ? 1 : 0
|
||||
param[0] = ['物料名称_check', materialName_check]
|
||||
param[1] = ['物料名称', row.物料名称]
|
||||
param[2] = ['图号或型号_check', specificationsModel_check]
|
||||
param[3] = ['图号或型号', row.图号或型号]
|
||||
param[4] = ['库位_check', 0]
|
||||
param[5] = ['库位', '']
|
||||
param[6] = ['排序名称', '']
|
||||
param[7] = ['排序方式', '']
|
||||
var Data = this.CreateData('11', '仓储管理_库存盘点_查询', param)
|
||||
return this.ExecDatabase(Data).then(response => {
|
||||
var rows = response.data.rows || response.data || []
|
||||
// 备注:修改人:Ld 修改时间:2026-07-15 17:14:07; 库存小窗只显示有库存的库位和对应数量。
|
||||
return rows.filter(function(item) {
|
||||
return Number(item.货位存量 || item.库存 || 0) > 0
|
||||
})
|
||||
})
|
||||
},
|
||||
getStockLocationDetail(row) {
|
||||
this.stockLocationLoading = true
|
||||
this.stockLocationData = []
|
||||
this.getInventoryLocationRows(row).then(rows => {
|
||||
this.stockLocationData = rows
|
||||
this.stockLocationLoading = false
|
||||
}).catch(() => {
|
||||
this.stockLocationLoading = false
|
||||
})
|
||||
},
|
||||
searchTable2() {
|
||||
var param = []
|
||||
param[0] = ['物料流水号', this.materialSerialNumber]
|
||||
var Data = this.CreateData('11', '库存查询_物料出入库记录_查询', param, this.pageSize1, this.pageCurrent1)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log('response.data', response.data)
|
||||
this.tableData9 = response.data.rows
|
||||
this.total1 = response.data.total
|
||||
})
|
||||
},
|
||||
handleEdit(row, column) {
|
||||
if (column.label === '物料编码') { // 备注:修改人:Ld 修改时间:2026-06-29 14:24:00
|
||||
if (column.label === '物料编码') { // 备注:修改人:Ld 修改时间:2026-07-15 17:14:07; 展开行继续使用原物料出入库记录。
|
||||
this.materialSerialNumber = row.物料流水号
|
||||
this.tableData9 = []
|
||||
this.searchTable2()
|
||||
@@ -559,11 +600,11 @@ export default {
|
||||
Promise.all(promises).then(function(results) {
|
||||
var data = []
|
||||
// 表头
|
||||
data.push(['物料编码', '物料名称', '图号型号', '库位', '库存', '需求数', '可用库存', '加工中', '采购中', '毛坯数', '单位', '类型', '库存批次', '待入库', '最低库存', '安全库存', '最高库存', '', '物料编码', '物料名称', '图号/型号', '类型', '出/入库数', '出/入库日期', '批次编码']) // 备注:修改人:Ld 修改时间:2026-06-29 14:24:00
|
||||
data.push(['物料编码', '物料名称', '图号型号', '库存', '需求数', '可用库存', '加工中', '采购中', '毛坯数', '单位', '类型', '库存批次', '待入库', '最低库存', '安全库存', '最高库存', '', '物料编码', '物料名称', '图号/型号', '类型', '出/入库数', '出/入库日期', '批次编码']) // 备注:修改人:Ld 修改时间:2026-07-15 17:14:07; 选中导出恢复原展开出入库记录明细。
|
||||
results.forEach(function(item) {
|
||||
var row = item.row
|
||||
var mainRow = [
|
||||
row.物料编码, row.物料名称, row.图号或型号, row.货位名称, row.库存,
|
||||
row.物料编码, row.物料名称, row.图号或型号, row.库存,
|
||||
row.需求量, row.库存 - row.需求量, row.加工中 < 0 ? 0 : row.加工中,
|
||||
row.采购中, row.毛坯库存, row.单位, row.类型, row.批次, row.预库存,
|
||||
row.最低库存, row.安全库存, row.最高库存, ''
|
||||
@@ -573,7 +614,7 @@ export default {
|
||||
if (idx === 0) {
|
||||
data.push(mainRow.concat([expand.物料编码, expand.物料名称, expand.图号或型号, expand.类型, expand.数量, expand.日期, expand.批次编号 || expand.批次编码]))
|
||||
} else {
|
||||
data.push(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', expand.物料编码, expand.物料名称, expand.图号或型号, expand.类型, expand.数量, expand.日期, expand.批次编号 || expand.批次编码])
|
||||
data.push(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', expand.物料编码, expand.物料名称, expand.图号或型号, expand.类型, expand.数量, expand.日期, expand.批次编号 || expand.批次编码])
|
||||
}
|
||||
})
|
||||
} else {
|
||||
@@ -582,12 +623,11 @@ export default {
|
||||
})
|
||||
var ws = XLSX.utils.aoa_to_sheet(data)
|
||||
ws['!cols'] = [
|
||||
{ wch: 15 }, { wch: 20 }, { wch: 15 }, { wch: 10 }, { wch: 8 },
|
||||
{ wch: 8 }, { wch: 10 }, { wch: 8 }, { wch: 8 }, { wch: 8 },
|
||||
{ wch: 6 }, { wch: 8 }, { wch: 12 }, { wch: 8 }, { wch: 10 },
|
||||
{ wch: 10 }, { wch: 10 }, { wch: 2 },
|
||||
{ wch: 15 }, { wch: 20 }, { wch: 15 }, { wch: 8 }, { wch: 10 },
|
||||
{ wch: 15 }, { wch: 15 }
|
||||
{ wch: 15 }, { wch: 20 }, { wch: 15 }, { wch: 8 }, { wch: 8 },
|
||||
{ wch: 10 }, { wch: 8 }, { wch: 8 }, { wch: 8 }, { wch: 6 },
|
||||
{ wch: 8 }, { wch: 12 }, { wch: 8 }, { wch: 10 }, { wch: 10 },
|
||||
{ wch: 10 }, { wch: 2 }, { wch: 15 }, { wch: 20 }, { wch: 15 },
|
||||
{ wch: 8 }, { wch: 10 }, { wch: 15 }, { wch: 15 }
|
||||
]
|
||||
var wb = XLSX.utils.book_new()
|
||||
XLSX.utils.book_append_sheet(wb, ws, '库存查询')
|
||||
@@ -605,8 +645,6 @@ export default {
|
||||
this.orderName = 1
|
||||
} else if (column.prop === '物料名称') {
|
||||
this.orderName = 2
|
||||
} else if (column.prop === '库位') {
|
||||
this.orderName = 3
|
||||
} else if (column.prop === '库存') {
|
||||
this.orderName = 4
|
||||
} else if (column.prop === '最低库存') {
|
||||
|
||||
@@ -7,9 +7,12 @@
|
||||
<el-input v-model="DrawingNo" style="width: 200px " size="small" clearable placeholder="图号/型号"/>
|
||||
<el-input v-model="locationWarehouseValue" style="width:200px" placeholder="库位" size="small" clearable/>
|
||||
<el-button style="margin-left: 7px;width: 80px" type="primary" plain size="small" @click="searchTable()">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-printer" style="margin-left: 7px" plain size="small" @click="printReceiptDoc1()">打印</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-table v-loading="loading" :data="tableData" highlight-current-row show-summary border stripe size="small" style="width: 731px" height="740px">
|
||||
<el-table ref="table" v-loading="loading" :data="tableData" highlight-current-row show-summary border stripe size="small" style="width: 731px" height="740px"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="50px"/>
|
||||
<el-table-column :width="setColumnWidth('序号')" type="index" label="序号" align="center"/>
|
||||
<el-table-column label="物料编码" align="center" show-overflow-tooltip><!-- 备注:修改人:Ld 修改时间:2026-06-29 14:24:00 -->
|
||||
<template slot-scope="scope">
|
||||
@@ -44,15 +47,57 @@
|
||||
@current-change="handleCurrentChanges"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card v-show="false">
|
||||
<div style="width:900px;margin-left: 350px">
|
||||
<el-card>
|
||||
<div id="WGBLD" style="width: 840px;margin: 0 auto">
|
||||
<div style="width: 260px;margin: 0 auto 20px">
|
||||
<h3>浙江景耀数控物料库位清单</h3>
|
||||
</div>
|
||||
<div style="margin: 0 0 20px">
|
||||
<span style="float: right; font-size: 14px;margin-right: 10px">日期:{{ NowTime }}</span>
|
||||
</div>
|
||||
<table align="center" border="1 solid black" cellspacing="0px" width="100%">
|
||||
<tr id="tablehead12" style="height: 35px">
|
||||
<td colspan="3" style="text-align: center;width: 25%;font-size: 14px">物料编码</td>
|
||||
<td colspan="5" style="text-align: center;width: 30%;font-size: 14px">物料名称</td>
|
||||
<td colspan="4" style="text-align: center;width: 22%;font-size: 14px">图号或型号</td>
|
||||
<td colspan="6" style="text-align: center;width: 23%;font-size: 14px">库位</td>
|
||||
</tr>
|
||||
<tr v-for="(list, index) in returns" :key="index" style="height: 35px">
|
||||
<td colspan="3" style="text-align: center;width: 25%;font-size: 14px">{{ list.物料编码 }}</td>
|
||||
<td colspan="5" style="text-align: center;width: 30%;font-size: 14px">{{ list.物料名称 }}</td>
|
||||
<td colspan="4" style="text-align: center;width: 22%;font-size: 14px">{{ list.规格型号 }}</td>
|
||||
<td colspan="6" style="text-align: center;width: 23%;font-size: 14px">{{ list.库位 }}</td>
|
||||
</tr>
|
||||
<tr style="height: 35px">
|
||||
<td colspan="12" style="text-align: center;font-size: 14px">合计</td>
|
||||
<td colspan="6" style="text-align: center;">
|
||||
<div>
|
||||
<span style="float: right;margin-right: 24%;font-size: 14px">{{ returns.length }} 条</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="margin-top: 15px"><span style="margin-left: 10px;font-size: 14px">制单:</span></div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ExecDatabase } from '@/main'
|
||||
import { mapGetters } from 'vuex'
|
||||
import $ from 'jquery'
|
||||
import { getNowDAY } from '@/utils'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
NowTime: getNowDAY(),
|
||||
returns: [],
|
||||
multipleSelection: [],
|
||||
locationWarehouseValue: '', // 库位
|
||||
MaterialCode: '',
|
||||
MaterialName: '',
|
||||
@@ -130,6 +175,49 @@ export default {
|
||||
handleCurrentChanges(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchTable()
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val
|
||||
},
|
||||
async printReceiptDoc1() {
|
||||
const aa = this.printReceiptDoc()
|
||||
if (aa === 2) {
|
||||
await this.sleep(500)
|
||||
await this.exportTable()
|
||||
} else if (aa === 1) {
|
||||
this.$message.warning('请勾选要打印的物料!!')
|
||||
}
|
||||
},
|
||||
sleep(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms))
|
||||
},
|
||||
exportTable() {
|
||||
const htmlNode = $('#WGBLD').html()
|
||||
const body = $('body')
|
||||
body.children().hide()
|
||||
const printNode = $(htmlNode)
|
||||
body.append(printNode)
|
||||
window.print()
|
||||
body.children().not('script').show()
|
||||
body.children().not('#app').hide()
|
||||
printNode.remove()
|
||||
},
|
||||
printReceiptDoc() {
|
||||
this.returns = []
|
||||
if (this.multipleSelection.length !== 0) {
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
this.returns.push({
|
||||
物料编码: this.multipleSelection[i].物料编号,
|
||||
物料名称: this.multipleSelection[i].物料名称,
|
||||
规格型号: this.multipleSelection[i].图号或型号,
|
||||
库位: this.multipleSelection[i].货位名称
|
||||
})
|
||||
}
|
||||
return 2
|
||||
} else {
|
||||
this.$message.warning('未勾选物料!!')
|
||||
return 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
v-model="PartType"
|
||||
type="border-card"
|
||||
style="height: 850px;padding: 0"
|
||||
@tab-click="pageCurrent=1;pageCurrent1=1">
|
||||
@tab-click="handleTabClick">
|
||||
<el-tab-pane label="采购入库" name="采购入库">
|
||||
<div style="margin-top: 7px; margin-bottom: 7px">
|
||||
<el-select
|
||||
@@ -279,6 +279,17 @@
|
||||
size="small"
|
||||
@click="submitInStorage2">入库
|
||||
</el-button>
|
||||
<!-- 修改人:Ld 修改时间:2026-07-14 09:05:57; 自制件入库增加入库单入口,按自制件类型加载待入库单 -->
|
||||
<el-badge :value="selfMadeRKDCount" class="item">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-s-home"
|
||||
style="margin-left: 10px"
|
||||
plain
|
||||
size="small"
|
||||
@click="showSelfMadeRKDDialog">入库单
|
||||
</el-button>
|
||||
</el-badge>
|
||||
</div>
|
||||
<div>
|
||||
<el-table
|
||||
@@ -546,8 +557,11 @@
|
||||
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisibleRKD" title="入库单" center width="700px">
|
||||
<el-table :data="tableDataRKDMerged" border stripe size="small" height="400px">
|
||||
<el-table-column prop="入库单号" label="入库单号" align="center" show-overflow-tooltip/>
|
||||
<el-table-column prop="采购合同号" label="采购合同" align="center" show-overflow-tooltip/>
|
||||
<el-table-column prop="供应商名称" label="供应商" align="center" show-overflow-tooltip/>
|
||||
<el-table-column v-if="rkdDialogType === '采购'" prop="采购合同号" label="采购合同" align="center" show-overflow-tooltip/>
|
||||
<el-table-column v-if="rkdDialogType === '采购'" prop="供应商名称" label="供应商" align="center" show-overflow-tooltip/>
|
||||
<!-- 修改人:Ld 修改时间:2026-07-14 09:05:57; 自制件入库单弹窗显示订单信息 -->
|
||||
<el-table-column v-if="rkdDialogType === '自制'" prop="订单号" label="订单号" align="center" show-overflow-tooltip/>
|
||||
<el-table-column v-if="rkdDialogType === '自制'" prop="类型" label="类型" align="center" show-overflow-tooltip/>
|
||||
<el-table-column prop="到货数" label="到货数" align="center" show-overflow-tooltip/>
|
||||
<el-table-column label="操作" align="center" width="80px">
|
||||
<template slot-scope="scope">
|
||||
@@ -711,6 +725,7 @@ export default {
|
||||
tableData3: [], // 合同信息表
|
||||
tableData30: [], // 合同信息表
|
||||
dialogFormVisibleRKD: false,
|
||||
rkdDialogType: '采购', // 修改人:Ld 修改时间:2026-07-14 09:05:57; 区分采购/自制件入库单弹窗
|
||||
tableDataRKD: [],
|
||||
pageCurrent: 1, // 分页当前页
|
||||
pageSize: 30, // 分页每页显示条数
|
||||
@@ -739,6 +754,16 @@ export default {
|
||||
}
|
||||
}
|
||||
return result
|
||||
},
|
||||
selfMadeRKDCount() {
|
||||
// 修改人:Ld 修改时间:2026-07-14 09:05:57; 统计自制件待入库单数量用于按钮角标
|
||||
var count = 0
|
||||
for (var i = 0; i < this.tableDataRKD.length; i++) {
|
||||
if (this.tableDataRKD[i].类型 === '自制') {
|
||||
count++
|
||||
}
|
||||
}
|
||||
return this.rkdDialogType === '自制' ? this.tableDataRKDMerged.length : count
|
||||
}
|
||||
},
|
||||
updated() {
|
||||
@@ -762,10 +787,20 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
loadRKDCounter() {
|
||||
// 修改人:Ld 修改时间:2026-07-14 09:05:57; 默认加载采购入库单数量,避免采购页混入自制件入库单
|
||||
this.loadRKDData('采购', false)
|
||||
},
|
||||
loadRKDData(type, showDialog) {
|
||||
// 修改人:Ld 修改时间:2026-07-14 09:05:57; 按采购/自制类型统一加载入库单数据
|
||||
var param = []
|
||||
param[0] = ['类型_check', 1]
|
||||
param[1] = ['类型', type]
|
||||
var Data = this.CreateData('11', '仓储管理_入库单_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.tableDataRKD = response.data.filter(item => item.是否入库 === 0 || item.是否入库 === false)
|
||||
if (showDialog) {
|
||||
this.dialogFormVisibleRKD = true
|
||||
}
|
||||
})
|
||||
},
|
||||
handleSupplierChange() {
|
||||
@@ -797,14 +832,23 @@ export default {
|
||||
this.supplierSelectionName = obj ? obj.label : ''
|
||||
},
|
||||
showRKDDialog() {
|
||||
var param = []
|
||||
var Data = this.CreateData('11', '仓储管理_入库单_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.tableDataRKD = response.data.filter(item => item.是否入库 === 0 || item.是否入库 === false )
|
||||
this.dialogFormVisibleRKD = true
|
||||
})
|
||||
this.rkdDialogType = '采购'
|
||||
this.loadRKDData('采购', true)
|
||||
},
|
||||
showSelfMadeRKDDialog() {
|
||||
// 修改人:Ld 修改时间:2026-07-14 09:05:57; 自制件入库页打开自制件入库单列表
|
||||
this.rkdDialogType = '自制'
|
||||
this.loadRKDData('自制', true)
|
||||
},
|
||||
selectRKDRow(row) {
|
||||
if (this.rkdDialogType === '自制') {
|
||||
this.orderSelectionValue = Number(row.订单流水号) || row.订单流水号
|
||||
this.numberSelectionValue = ''
|
||||
this.getnumberSelection()
|
||||
this.searchTable3()
|
||||
this.dialogFormVisibleRKD = false
|
||||
return
|
||||
}
|
||||
this.supplierSelectionValue = row.供应商流水号
|
||||
this.getContractState()
|
||||
this.$nextTick(() => {
|
||||
@@ -814,6 +858,13 @@ export default {
|
||||
})
|
||||
this.dialogFormVisibleRKD = false
|
||||
},
|
||||
handleTabClick() {
|
||||
// 修改人:Ld 修改时间:2026-07-14 09:05:57; 切换页签时刷新对应类型的入库单数量
|
||||
this.pageCurrent = 1
|
||||
this.pageCurrent1 = 1
|
||||
this.rkdDialogType = this.PartType === '自制件入库' ? '自制' : '采购'
|
||||
this.loadRKDData(this.rkdDialogType, false)
|
||||
},
|
||||
exportTable() {
|
||||
const htmlNode = $('#WGBLD').html()
|
||||
const body = $('body')
|
||||
|
||||
Reference in New Issue
Block a user