add:新增其他球磨参数维护、下发

This commit is contained in:
2026-08-06 19:02:20 +08:00
parent 2ced1e6083
commit 02e6467970
12 changed files with 688 additions and 13 deletions

View File

@@ -31,4 +31,20 @@ export function del(data) {
})
}
export default { getTableTitle, getSetData, saveData, del }
export function getBallMillParam(data) {
return request({
url: 'api/productProcessParam/getBallMillParam',
method: 'post',
data
})
}
export function saveBallMillParam(data) {
return request({
url: 'api/productProcessParam/saveBallMillParam',
method: 'post',
data
})
}
export default { getTableTitle, getSetData, saveData, del, getBallMillParam, saveBallMillParam }

View File

@@ -0,0 +1,341 @@
<template>
<el-dialog
title="其他球磨参数设置"
append-to-body
:visible.sync="dialogVisible"
width="90%"
destroy-on-close
@close="close"
>
<!-- 原浆卸料参数表 -->
<div class="table-section">
<h3 class="table-title">原浆卸料参数表</h3>
<el-table
:data="[1,2,3,4]"
stripe
border
size="mini"
style="width: 100%"
:header-cell-style="{ background: '#f5f7fa', textAlign: 'center' }"
>
<el-table-column label="参数" width="60" align="center">
<template slot-scope="scope">{{ scope.row }}</template>
</el-table-column>
<el-table-column label="卸料角度" align="center">
<template slot-scope="scope">
<el-input-number v-model="slurryParams['slurry_angle'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
</template>
</el-table-column>
<el-table-column label="卸料时间 S" align="center">
<template slot-scope="scope">
<el-input-number v-model="slurryParams['slurry_time'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
</template>
</el-table-column>
<el-table-column label="参数" width="60" align="center">
<template slot-scope="scope">{{ scope.row + 4 }}</template>
</el-table-column>
<el-table-column label="卸料角度" align="center">
<template slot-scope="scope">
<el-input-number v-model="slurryParams['slurry_angle'+(scope.row+4)]" :controls="false" :precision="1" size="small" style="width:100%" />
</template>
</el-table-column>
<el-table-column label="卸料时间 S" align="center">
<template slot-scope="scope">
<el-input-number v-model="slurryParams['slurry_time'+(scope.row+4)]" :controls="false" :precision="1" size="small" style="width:100%" />
</template>
</el-table-column>
</el-table>
</div>
<el-divider />
<!-- 酒精卸料参数表 -->
<div class="table-section">
<h3 class="table-title">酒精卸料参数表</h3>
<el-table
:data="[1,2,3,4,5,6,7,8]"
stripe
border
size="mini"
style="width: 100%"
:header-cell-style="{ background: '#f5f7fa', textAlign: 'center' }"
>
<el-table-column label="参数" width="60" align="center">
<template slot-scope="scope">{{ scope.row }}</template>
</el-table-column>
<el-table-column label="加酒精量 L" align="center">
<template slot-scope="scope">
<el-input-number v-model="alcoholParams['alc_qty'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
</template>
</el-table-column>
<el-table-column label="加酒精角度" align="center">
<template slot-scope="scope">
<el-input-number v-model="alcoholParams['alc_alcangle'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
</template>
</el-table-column>
<el-table-column label="卸料角度" align="center">
<template slot-scope="scope">
<el-input-number v-model="alcoholParams['alc_angle'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
</template>
</el-table-column>
<el-table-column label="平磨时间 S" align="center">
<template slot-scope="scope">
<el-input-number v-model="alcoholParams['alc_flattime'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
</template>
</el-table-column>
<el-table-column label="卸料时间 S" align="center">
<template slot-scope="scope">
<el-input-number v-model="alcoholParams['alc_time'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
</template>
</el-table-column>
</el-table>
</div>
<el-divider />
<!-- 清洗参数表 -->
<div class="table-section">
<h3 class="table-title">清洗参数表</h3>
<el-table
:data="[1,2,3,4,5]"
stripe
border
size="mini"
style="width: 100%"
:header-cell-style="{ background: '#f5f7fa', textAlign: 'center' }"
>
<el-table-column label="参数" width="60" align="center">
<template slot-scope="scope">{{ scope.row }}</template>
</el-table-column>
<el-table-column label="加水量 L" align="center">
<template slot-scope="scope">
<el-input-number v-model="cleanParams['clean_waterqty'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
</template>
</el-table-column>
<el-table-column label="加水角度" align="center">
<template slot-scope="scope">
<el-input-number v-model="cleanParams['clean_waterangle'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
</template>
</el-table-column>
<el-table-column label="卸料角度" align="center">
<template slot-scope="scope">
<el-input-number v-model="cleanParams['clean_angle'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
</template>
</el-table-column>
<el-table-column label="平磨时间 S" align="center">
<template slot-scope="scope">
<el-input-number v-model="cleanParams['clean_flattime'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
</template>
</el-table-column>
<el-table-column label="卸料时间 S" align="center">
<template slot-scope="scope">
<el-input-number v-model="cleanParams['clean_time'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
</template>
</el-table-column>
<el-table-column label="静止时间 S" align="center">
<template slot-scope="scope">
<el-input-number v-model="cleanParams['clean_resttime'+scope.row]" :controls="false" :precision="1" size="small" style="width:100%" />
</template>
</el-table-column>
</el-table>
</div>
<el-divider />
<!-- 酒精卸料参数表(单行) -->
<div class="table-section">
<el-table
:data="[1]"
stripe
border
size="mini"
style="width: 100%"
:header-cell-style="{ background: '#f5f7fa', textAlign: 'center' }"
>
<el-table-column label="参数" width="60" align="center">
<template slot-scope="scope">{{ 6 }}</template>
</el-table-column>
<el-table-column label="加酒精量 L" align="center">
<template>
<el-input-number v-model="extraAlcoholParams.extra_qty" :controls="false" :precision="1" size="small" style="width:100%" />
</template>
</el-table-column>
<el-table-column label="加酒精角度" align="center">
<template>
<el-input-number v-model="extraAlcoholParams.extra_alcangle" :controls="false" :precision="1" size="small" style="width:100%" />
</template>
</el-table-column>
<el-table-column label="卸料角度" align="center">
<template>
<el-input-number v-model="extraAlcoholParams.extra_angle" :controls="false" :precision="1" size="small" style="width:100%" />
</template>
</el-table-column>
<el-table-column label="平磨时间 S" align="center">
<template>
<el-input-number v-model="extraAlcoholParams.extra_flattime" :controls="false" :precision="1" size="small" style="width:100%" />
</template>
</el-table-column>
<el-table-column label="卸料时间 S" align="center">
<template>
<el-input-number v-model="extraAlcoholParams.extra_time" :controls="false" :precision="1" size="small" style="width:100%" />
</template>
</el-table-column>
</el-table>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="close"> </el-button>
<el-button type="primary" @click="onSubmit"> </el-button>
</span>
</el-dialog>
</template>
<script>
import crudProductProcessParam from '@/api/wms/basedata/pdm/productProcessParam'
// 原浆卸料默认数据
const defaultSlurryParams = {
slurry_angle1: 0, slurry_time1: 0, slurry_angle2: 0, slurry_time2: 0,
slurry_angle3: 0, slurry_time3: 0, slurry_angle4: 0, slurry_time4: 0,
slurry_angle5: 0, slurry_time5: 0, slurry_angle6: 0, slurry_time6: 0,
slurry_angle7: 0, slurry_time7: 0, slurry_angle8: 0, slurry_time8: 0
}
// 酒精卸料默认数据
const defaultAlcoholParams = {
alc_qty1: 0, alc_alcangle1: 0, alc_angle1: 0, alc_flattime1: 0, alc_time1: 0,
alc_qty2: 0, alc_alcangle2: 0, alc_angle2: 0, alc_flattime2: 0, alc_time2: 0,
alc_qty3: 0, alc_alcangle3: 0, alc_angle3: 0, alc_flattime3: 0, alc_time3: 0,
alc_qty4: 0, alc_alcangle4: 0, alc_angle4: 0, alc_flattime4: 0, alc_time4: 0,
alc_qty5: 0, alc_alcangle5: 0, alc_angle5: 0, alc_flattime5: 0, alc_time5: 0,
alc_qty6: 0, alc_alcangle6: 0, alc_angle6: 0, alc_flattime6: 0, alc_time6: 0,
alc_qty7: 0, alc_alcangle7: 0, alc_angle7: 0, alc_flattime7: 0, alc_time7: 0,
alc_qty8: 0, alc_alcangle8: 0, alc_angle8: 0, alc_flattime8: 0, alc_time8: 0
}
// 清洗默认数据
const defaultCleanParams = {
clean_waterqty1: 0, clean_waterangle1: 0, clean_angle1: 0, clean_flattime1: 0, clean_time1: 0, clean_resttime1: 0,
clean_waterqty2: 0, clean_waterangle2: 0, clean_angle2: 0, clean_flattime2: 0, clean_time2: 0, clean_resttime2: 0,
clean_waterqty3: 0, clean_waterangle3: 0, clean_angle3: 0, clean_flattime3: 0, clean_time3: 0, clean_resttime3: 0,
clean_waterqty4: 0, clean_waterangle4: 0, clean_angle4: 0, clean_flattime4: 0, clean_time4: 0, clean_resttime4: 0,
clean_waterqty5: 0, clean_waterangle5: 0, clean_angle5: 0, clean_flattime5: 0, clean_time5: 0, clean_resttime5: 0
}
const defaultExtraAlcoholParams = {
extra_qty: 0, extra_alcangle: 0, extra_angle: 0, extra_flattime: 0, extra_time: 0
}
function createEmptyParams(defaults) {
const obj = {}
Object.keys(defaults).forEach(k => { obj[k] = null })
return obj
}
export default {
name: 'BallMillParamDialog',
props: {
dialogShow: {
type: Boolean,
default: false
},
openParam: {
type: Object,
default: () => ({})
}
},
data() {
return {
dialogVisible: false,
slurryParams: createEmptyParams(defaultSlurryParams),
alcoholParams: createEmptyParams(defaultAlcoholParams),
cleanParams: createEmptyParams(defaultCleanParams),
extraAlcoholParams: createEmptyParams(defaultExtraAlcoholParams)
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
if (newValue) {
this.loadData()
}
}
}
},
methods: {
loadData() {
const param = {
workprocedure_code: this.openParam.workprocedure_code,
material_id: this.openParam.optRow
}
crudProductProcessParam.getBallMillParam(param).then(res => {
// 过滤掉后端返回的 null 值,防止覆盖 default*Params 的默认值 0
// 否则 WQL 框架 insert 时会跳过 null 字段,导致只插入 material_id 而丢失业务数据
const filterNulls = (obj) => {
if (!obj) return {}
const filtered = {}
Object.keys(obj).forEach(k => {
if (obj[k] != null) filtered[k] = obj[k]
})
return filtered
}
this.slurryParams = { ...defaultSlurryParams, ...filterNulls(res.slurryParams) }
this.alcoholParams = { ...defaultAlcoholParams, ...filterNulls(res.alcoholParams) }
this.cleanParams = { ...defaultCleanParams, ...filterNulls(res.cleanParams) }
this.extraAlcoholParams = { ...defaultExtraAlcoholParams, ...filterNulls(res.extraAlcoholParams) }
}).catch(() => {
this.slurryParams = { ...defaultSlurryParams }
this.alcoholParams = { ...defaultAlcoholParams }
this.cleanParams = { ...defaultCleanParams }
this.extraAlcoholParams = { ...defaultExtraAlcoholParams }
})
},
onSubmit() {
const param = {
workprocedure_code: this.openParam.workprocedure_code,
material_id: this.openParam.optRow,
slurryParams: this.slurryParams,
alcoholParams: this.alcoholParams,
cleanParams: this.cleanParams,
extraAlcoholParams: this.extraAlcoholParams
}
crudProductProcessParam.saveBallMillParam(param).then(() => {
this.$notify({
title: '保存成功',
type: 'success',
duration: 2500
})
this.close()
}).catch(() => {
this.$notify({
title: '保存失败,请联系管理员',
type: 'error',
duration: 2500
})
})
},
close() {
this.slurryParams = createEmptyParams(defaultSlurryParams)
this.alcoholParams = createEmptyParams(defaultAlcoholParams)
this.cleanParams = createEmptyParams(defaultCleanParams)
this.extraAlcoholParams = createEmptyParams(defaultExtraAlcoholParams)
this.$emit('update:dialogShow', false)
}
}
}
</script>
<style scoped>
.table-section {
margin-bottom: 10px;
}
.table-title {
font-size: 15px;
font-weight: bold;
color: #303133;
margin: 0 0 10px 0;
padding-left: 8px;
border-left: 4px solid #409EFF;
text-align: center;
}
</style>

View File

@@ -13,7 +13,19 @@
class="filter-item"
/>
<rrOperation />
<crudOperation :permission="permission" />
<crudOperation :permission="permission">
<el-button
slot="right"
class="filter-item"
type="success"
:disabled="openParamFlag"
icon="el-icon-position"
size="mini"
@click="openParamView"
>
其他球磨参数设置
</el-button>
</crudOperation>
<!--表单组件-->
<!--表格渲染-->
<el-table
@@ -23,7 +35,10 @@
size="mini"
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
@select="handleSelectionChange"
@select-all="onSelectAll"
>
<el-table-column type="selection" width="55" fixed />
<el-table-column prop="material_code" label="物料编码" min-width="130" fixed />
<el-table-column prop="material_name" label="物料名称" min-width="100" fixed />
@@ -50,6 +65,7 @@
</div>
<SetDialog :dialog-show.sync="setShow" :open-param="openParam" />
<BallMillParamDialog :dialog-show.sync="ballMillShow" :open-param="openParam" />
</div>
</template>
@@ -62,11 +78,11 @@ import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import SetDialog from '@/views/wms/basedata/pdm/productProcessParam/SetDialog'
import crudBagrecord from '@/api/wms/basedata/master/bagrecord'
import BallMillParamDialog from '@/views/wms/basedata/pdm/productProcessParam/BallMillParamDialog'
export default {
name: 'ProductProcessParam',
components: { pagination, crudOperation, rrOperation, udOperation, SetDialog },
components: { pagination, crudOperation, rrOperation, udOperation, SetDialog, BallMillParamDialog },
mixins: [presenter(), header(), form(), crud()],
cruds() {
return CRUD({
@@ -87,8 +103,11 @@ export default {
data() {
return {
permission: {},
currentRow: {},
workprocedure_code: null,
setShow: false,
ballMillShow: false,
openParamFlag: true,
openParam: {},
// 行转列https://www.jb51.net/article/196058.htm
cols: [],
@@ -161,6 +180,32 @@ export default {
this.crud.notify('删除成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
})
},
handleSelectionChange(val, row) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
this.currentRow = row
this.openParamFlag = false
} else if (val.length === 1) {
this.currentRow = row
this.openParamFlag = false
} else {
this.openParamFlag = true
this.currentRow = {}
}
},
onSelectAll() {
this.$refs.table.clearSelection()
this.openParamFlag = true
this.currentRow = {}
},
openParamView() {
this.openParam = {
optRow: this.currentRow.material_id,
workprocedure_code: this.workprocedure_code
}
this.ballMillShow = true
}
}
}

View File

@@ -313,8 +313,8 @@ export default {
crudSectattr.getSect({ 'is_materialstore': '1', 'sect_type_attr': '00' }).then(res => {
this.sects = res.content
})
let area_type = ''
if (this.billType === '000101' || this.billType === '000102' || this.billType === '000201' || this.billType === '000202' || this.billType === '000305') {
let area_type = '\'21\''
if (this.billType === '000101' || this.billType === '000102' || this.billType === '000201' || this.billType === '000202' || this.billType === '000203' || this.billType === '000305' || this.billType === '000103') {
area_type = '\'21\''
}
if (this.billType === '000301' || this.billType === '000303' || this.billType === '000304') {