移除物料监控录入半成品功能
Some checks failed
Release pipeline / publish (push) Has been cancelled
Release pipeline / Always run job (push) Has been cancelled

This commit is contained in:
sheng
2026-06-25 15:44:48 +08:00
parent e6866e54aa
commit a79db56124

View File

@@ -65,7 +65,7 @@
:columns="columns"
:data="tableData"
:loading="loading"
:toolbar-buttons="toolbarButtons"
:toolbar-buttons="[]"
:row-buttons="[]"
:pagination="pagination"
:table-attrs="{ size: 'mini', rowKey: 'id', highlightCurrentRow: true }"
@@ -81,114 +81,23 @@
<el-empty :description="$t('暂无数据')" :image-size="80" />
</template>
</page-table>
<page-dialog-form
ref="dialogForm"
:visible.sync="dialogVisible"
:title="key('input_semi_product_data')"
width="520px"
:form-cols="[]"
:form-data="form"
:rules="rules"
label-width="130px"
:submitting="submitting"
:confirm-text="key('confirm')"
:cancel-text="key('cancel')"
@submit="submitForm"
@close="onDialogClose"
>
<el-form-item :label="$t(key('batch_id'))" prop="batch_id">
<el-select
v-model="form.batch_id"
:placeholder="$t(key('select_batch_id'))"
clearable
filterable
size="mini"
style="width:100%"
@focus="loadBatchOptions"
@change="onBatchChange"
>
<el-option
v-for="item in batchOptions"
:key="item.id"
:label="item.batch"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t(key('workingsubclass'))" prop="process_code">
<el-select
v-model="form.process_code"
:placeholder="$t(key('select_workingsubclass'))"
clearable
filterable
size="mini"
style="width:100%"
:disabled="!form.batch_id"
>
<el-option
v-for="item in selectedBatchProcesses"
:key="item.code || item.name"
:label="item.name || item.code"
:value="item.code || item.name"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t(key('device_code'))" prop="device_code">
<el-select
v-model="form.device_code"
:placeholder="$t(key('select_device_code'))"
clearable
filterable
size="mini"
style="width:100%"
@focus="loadDeviceOptions"
>
<el-option
v-for="item in deviceOptions"
:key="item.code || item.device_code"
:label="item.name || item.device_name || item.code || item.device_code"
:value="item.code || item.device_code"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t(key('output_quantity'))" prop="item_quantity">
<el-input-number v-model="form.item_quantity" :min="1" size="mini" style="width:100%" />
</el-form-item>
<el-form-item :label="$t(key('output_date'))" prop="start_time">
<el-date-picker
v-model="form.start_time"
type="date"
value-format="yyyy-MM-dd"
size="mini"
style="width:100%"
:placeholder="$t(key('output_date'))"
/>
</el-form-item>
</page-dialog-form>
</d2-container>
</template>
<script>
import { useTableColumns } from '@/composables/useTableColumns'
import useTableButtons from '@/composables/useTableButtons'
import { i18nMixin } from '@/composables/useI18n'
import PageTable from '@/components/page-table'
import PageDialogForm from '@/components/page-dialog-form'
import { getBatchAll } from '@/api/planning-production/batch-list'
import { getDeviceAll } from '@/api/planning-production/equipment-monitoring'
import { createWipData, getWipDataList } from '@/api/planning-production/material-monitoring'
import { getWipDataList } from '@/api/planning-production/material-monitoring'
import { getWorkingsubclassAll } from '@/api/production-master-data/process-step'
export default {
name: 'planning-production-material-monitoring',
components: { PageTable, PageDialogForm },
components: { PageTable },
mixins: [i18nMixin('page.planning_production.production_monitoring.material_monitoring')],
data () {
return {
loading: false,
submitting: false,
dialogVisible: false,
search: {
batch: '',
item_id: '',
@@ -201,15 +110,6 @@ export default {
size: 10,
total: 0
},
form: {
batch_id: '',
process_code: '',
device_code: '',
item_quantity: undefined,
start_time: ''
},
batchOptions: [],
deviceOptions: [],
processOptions: []
}
},
@@ -228,35 +128,6 @@ export default {
selectionWidth: 0,
indexWidth: 55
})
},
toolbarButtons () {
return useTableButtons({
toolbar: [
{
key: 'create',
label: this.key('input_semi_product_data'),
type: 'primary',
icon: 'el-icon-plus',
size: 'mini',
auth: '/planning_production/production_batch_management/batch/create',
onClick: this.openDialog
}
]
}, this.$permission).toolbarButtons
},
rules () {
return {
batch_id: [{ required: true, message: this.key('select_batch_id'), trigger: 'change' }],
process_code: [{ required: true, message: this.key('select_workingsubclass'), trigger: 'change' }],
device_code: [{ required: true, message: this.key('select_device_code'), trigger: 'change' }],
item_quantity: [{ required: true, message: this.key('enter_output_quantity'), trigger: 'change' }]
}
},
selectedBatch () {
return this.batchOptions.find(item => String(item.id) === String(this.form.batch_id)) || {}
},
selectedBatchProcesses () {
return Array.isArray(this.selectedBatch.process) ? this.selectedBatch.process : []
}
},
created () {
@@ -332,52 +203,10 @@ export default {
this.pagination = pagination
this.fetchData()
},
openDialog () {
this.dialogVisible = true
this.form = {
batch_id: '',
process_code: '',
device_code: '',
item_quantity: undefined,
start_time: ''
}
this.$nextTick(() => {
if (this.$refs.dialogForm) this.$refs.dialogForm.reset()
})
this.loadBatchOptions()
this.loadDeviceOptions()
},
async loadBatchOptions () {
if (this.batchOptions.length) return
const res = await getBatchAll({})
this.batchOptions = this.normalizeList(res)
},
async loadDeviceOptions () {
if (this.deviceOptions.length) return
const res = await getDeviceAll({})
this.deviceOptions = this.normalizeList(res)
},
async loadProcessOptions () {
if (this.processOptions.length) return
const res = await getWorkingsubclassAll({})
this.processOptions = this.normalizeList(res)
},
onBatchChange () {
this.form.process_code = ''
},
onDialogClose () {
this.submitting = false
},
async submitForm () {
this.submitting = true
try {
await createWipData({ ...this.form })
this.$message.success(this.$t(this.key('operation_success')))
this.dialogVisible = false
this.fetchData()
} finally {
this.submitting = false
}
}
}
}