移除物料监控录入半成品功能
This commit is contained in:
@@ -65,7 +65,7 @@
|
|||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:toolbar-buttons="toolbarButtons"
|
:toolbar-buttons="[]"
|
||||||
:row-buttons="[]"
|
:row-buttons="[]"
|
||||||
:pagination="pagination"
|
:pagination="pagination"
|
||||||
:table-attrs="{ size: 'mini', rowKey: 'id', highlightCurrentRow: true }"
|
:table-attrs="{ size: 'mini', rowKey: 'id', highlightCurrentRow: true }"
|
||||||
@@ -81,114 +81,23 @@
|
|||||||
<el-empty :description="$t('暂无数据')" :image-size="80" />
|
<el-empty :description="$t('暂无数据')" :image-size="80" />
|
||||||
</template>
|
</template>
|
||||||
</page-table>
|
</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>
|
</d2-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { useTableColumns } from '@/composables/useTableColumns'
|
import { useTableColumns } from '@/composables/useTableColumns'
|
||||||
import useTableButtons from '@/composables/useTableButtons'
|
|
||||||
import { i18nMixin } from '@/composables/useI18n'
|
import { i18nMixin } from '@/composables/useI18n'
|
||||||
import PageTable from '@/components/page-table'
|
import PageTable from '@/components/page-table'
|
||||||
import PageDialogForm from '@/components/page-dialog-form'
|
import { getWipDataList } from '@/api/planning-production/material-monitoring'
|
||||||
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 { getWorkingsubclassAll } from '@/api/production-master-data/process-step'
|
import { getWorkingsubclassAll } from '@/api/production-master-data/process-step'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'planning-production-material-monitoring',
|
name: 'planning-production-material-monitoring',
|
||||||
components: { PageTable, PageDialogForm },
|
components: { PageTable },
|
||||||
mixins: [i18nMixin('page.planning_production.production_monitoring.material_monitoring')],
|
mixins: [i18nMixin('page.planning_production.production_monitoring.material_monitoring')],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
submitting: false,
|
|
||||||
dialogVisible: false,
|
|
||||||
search: {
|
search: {
|
||||||
batch: '',
|
batch: '',
|
||||||
item_id: '',
|
item_id: '',
|
||||||
@@ -201,15 +110,6 @@ export default {
|
|||||||
size: 10,
|
size: 10,
|
||||||
total: 0
|
total: 0
|
||||||
},
|
},
|
||||||
form: {
|
|
||||||
batch_id: '',
|
|
||||||
process_code: '',
|
|
||||||
device_code: '',
|
|
||||||
item_quantity: undefined,
|
|
||||||
start_time: ''
|
|
||||||
},
|
|
||||||
batchOptions: [],
|
|
||||||
deviceOptions: [],
|
|
||||||
processOptions: []
|
processOptions: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -228,35 +128,6 @@ export default {
|
|||||||
selectionWidth: 0,
|
selectionWidth: 0,
|
||||||
indexWidth: 55
|
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 () {
|
created () {
|
||||||
@@ -332,52 +203,10 @@ export default {
|
|||||||
this.pagination = pagination
|
this.pagination = pagination
|
||||||
this.fetchData()
|
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 () {
|
async loadProcessOptions () {
|
||||||
if (this.processOptions.length) return
|
if (this.processOptions.length) return
|
||||||
const res = await getWorkingsubclassAll({})
|
const res = await getWorkingsubclassAll({})
|
||||||
this.processOptions = this.normalizeList(res)
|
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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user