| | |
| | | const submitButton = ref(null); |
| | | const isSave = ref(true); |
| | | const open = ref(false); |
| | | const extendField = ref([]); |
| | | const initFormData = {} |
| | | let formData = ref(initFormData); |
| | | |
| | |
| | | console.log('Failed:', errorInfo); |
| | | }; |
| | | |
| | | const locQueryList = ref(null); |
| | | const locQueryList = ref(null); |
| | | locQuery(); |
| | | function locQuery() { |
| | | postForm('/api/loc/query', {}).then(resp => { |
| | | function locQuery() { |
| | | postForm('/api/loc/query', {}).then(resp => { |
| | | let result = resp.data; |
| | | locQueryList.value = result.data; |
| | | }) |
| | | } |
| | | const matQueryList = ref(null); |
| | | const matQueryList = ref(null); |
| | | matQuery(); |
| | | function matQuery() { |
| | | postForm('/api/mat/query', {}).then(resp => { |
| | | function matQuery() { |
| | | postForm('/api/mat/query', {}).then(resp => { |
| | | let result = resp.data; |
| | | matQueryList.value = result.data; |
| | | }) |
| | | } |
| | | const userQueryList = ref(null); |
| | | const userQueryList = ref(null); |
| | | userQuery(); |
| | | function userQuery() { |
| | | postForm('/api/user/query', {}).then(resp => { |
| | | function userQuery() { |
| | | postForm('/api/user/query', {}).then(resp => { |
| | | let result = resp.data; |
| | | userQueryList.value = result.data; |
| | | }) |
| | | } |
| | | |
| | | //扩展字段 |
| | | getColumns() |
| | | async function getColumns() { |
| | | let fieldResp = await post('/api/matField/list', { |
| | | fieldType: 1 |
| | | }) |
| | | let fieldResult = fieldResp.data; |
| | | if (fieldResult.code == 200) { |
| | | let data = fieldResult.data; |
| | | extendField.value = data; |
| | | } else if (result.code === 401) { |
| | | message.error(result.msg); |
| | | logout() |
| | | } else { |
| | | message.error(result.msg); |
| | | } |
| | | } |
| | | |
| | | defineExpose({ |
| | | open, |
| | |
| | | <a-modal v-model:open="open" |
| | | :title="isSave ? formatMessage('page.add', '添加') : formatMessage('page.edit', '编辑')" @ok="handleOk" |
| | | style="width: 600px;"> |
| | | <a-form :model="formData" ref="formTable" name="formTable" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" |
| | | style="display: flex;justify-content: space-between;flex-wrap: wrap;" autocomplete="off" |
| | | @finish="onFinish" @finishFailed="onFinishFailed"> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_loc_detl.loc_id', '库位') " |
| | | name="locId" |
| | | style="width: 250px;" |
| | | > |
| | | <a-select |
| | | v-model:value="formData.locId" |
| | | :placeholder="formatMessage('common.select', '请选择')" |
| | | style="width: 100%" |
| | | show-search |
| | | :options="locQueryList" |
| | | optionFilterProp="label" |
| | | optionLabelProp="label" |
| | | > |
| | | <a-form :model="formData" ref="formTable" name="formTable" :label-col="{ span: 8 }" |
| | | :wrapper-col="{ span: 16 }" style="display: flex;justify-content: space-between;flex-wrap: wrap;" |
| | | autocomplete="off" @finish="onFinish" @finishFailed="onFinishFailed"> |
| | | <a-form-item :label="formatMessage('db.man_loc_detl.loc_id', '库位')" name="locId" style="width: 250px;"> |
| | | <a-select v-model:value="formData.locId" :placeholder="formatMessage('common.select', '请选择')" |
| | | style="width: 100%" show-search :options="locQueryList" optionFilterProp="label" |
| | | optionLabelProp="label"> |
| | | </a-select> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_loc_detl.loc_no', '库位号') " |
| | | name="locNo" |
| | | style="width: 250px;" |
| | | :rules="[{ required: true }]" |
| | | > |
| | | <a-input |
| | | v-model:value="formData.locNo" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_loc_detl.mat_id', '物料') " |
| | | name="matId" |
| | | style="width: 250px;" |
| | | > |
| | | <a-select |
| | | v-model:value="formData.matId" |
| | | :placeholder="formatMessage('common.select', '请选择')" |
| | | style="width: 100%" |
| | | show-search |
| | | :options="matQueryList" |
| | | optionFilterProp="label" |
| | | optionLabelProp="label" |
| | | > |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_loc_detl.loc_no', '库位号')" name="locNo" style="width: 250px;" |
| | | :rules="[{ required: true }]"> |
| | | <a-input v-model:value="formData.locNo" /> |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_loc_detl.mat_id', '物料')" name="matId" style="width: 250px;"> |
| | | <a-select v-model:value="formData.matId" :placeholder="formatMessage('common.select', '请选择')" |
| | | style="width: 100%" show-search :options="matQueryList" optionFilterProp="label" |
| | | optionLabelProp="label"> |
| | | </a-select> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_loc_detl.matnr', '物料号') " |
| | | name="matnr" |
| | | style="width: 250px;" |
| | | > |
| | | <a-input |
| | | v-model:value="formData.matnr" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_loc_detl.order_no', '订单号') " |
| | | name="orderNo" |
| | | style="width: 250px;" |
| | | > |
| | | <a-input |
| | | v-model:value="formData.orderNo" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_loc_detl.batch', '批号') " |
| | | name="batch" |
| | | style="width: 250px;" |
| | | > |
| | | <a-input |
| | | v-model:value="formData.batch" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_loc_detl.anfme', '数量') " |
| | | name="anfme" |
| | | style="width: 250px;" |
| | | > |
| | | <a-input |
| | | v-model:value="formData.anfme" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_loc_detl.extend', '扩展') " |
| | | name="extend" |
| | | style="width: 250px;" |
| | | > |
| | | <a-input |
| | | v-model:value="formData.extend" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_loc_detl.status', '状态') " |
| | | name="status" |
| | | style="width: 250px;" |
| | | > |
| | | <a-select |
| | | v-model:value="formData.status" |
| | | :options="[ |
| | | { label: '正常', value: 1 }, |
| | | { label: '禁用', value: 0 }, |
| | | ]" |
| | | > |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_loc_detl.matnr', '物料号')" name="matnr" style="width: 250px;"> |
| | | <a-input v-model:value="formData.matnr" /> |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_loc_detl.order_no', '订单号')" name="orderNo" |
| | | style="width: 250px;"> |
| | | <a-input v-model:value="formData.orderNo" /> |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_loc_detl.batch', '批号')" name="batch" style="width: 250px;"> |
| | | <a-input v-model:value="formData.batch" /> |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_loc_detl.anfme', '数量')" name="anfme" style="width: 250px;"> |
| | | <a-input v-model:value="formData.anfme" /> |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_loc_detl.status', '状态')" name="status" |
| | | style="width: 250px;"> |
| | | <a-select v-model:value="formData.status" :options="[ |
| | | { label: '正常', value: 1 }, |
| | | { label: '禁用', value: 0 }, |
| | | ]"> |
| | | </a-select> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_loc_detl.create_time', '添加时间') " |
| | | name="createTime" |
| | | style="width: 250px;" |
| | | > |
| | | <a-date-picker |
| | | v-model:value="formData.createTime" |
| | | show-time |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_loc_detl.create_by', '添加人员') " |
| | | name="createBy" |
| | | style="width: 250px;" |
| | | > |
| | | <a-select |
| | | v-model:value="formData.createBy" |
| | | :placeholder="formatMessage('common.select', '请选择')" |
| | | style="width: 100%" |
| | | show-search |
| | | :options="userQueryList" |
| | | optionFilterProp="label" |
| | | optionLabelProp="label" |
| | | > |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_loc_detl.create_time', '添加时间')" name="createTime" |
| | | style="width: 250px;"> |
| | | <a-date-picker v-model:value="formData.createTime" show-time format="YYYY-MM-DD HH:mm:ss" |
| | | value-format="YYYY-MM-DD HH:mm:ss" /> |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_loc_detl.create_by', '添加人员')" name="createBy" |
| | | style="width: 250px;"> |
| | | <a-select v-model:value="formData.createBy" :placeholder="formatMessage('common.select', '请选择')" |
| | | style="width: 100%" show-search :options="userQueryList" optionFilterProp="label" |
| | | optionLabelProp="label"> |
| | | </a-select> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_loc_detl.update_time', '修改时间') " |
| | | name="updateTime" |
| | | style="width: 250px;" |
| | | > |
| | | <a-date-picker |
| | | v-model:value="formData.updateTime" |
| | | show-time |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_loc_detl.update_by', '修改人员') " |
| | | name="updateBy" |
| | | style="width: 250px;" |
| | | > |
| | | <a-select |
| | | v-model:value="formData.updateBy" |
| | | :placeholder="formatMessage('common.select', '请选择')" |
| | | style="width: 100%" |
| | | show-search |
| | | :options="userQueryList" |
| | | optionFilterProp="label" |
| | | optionLabelProp="label" |
| | | > |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_loc_detl.update_time', '修改时间')" name="updateTime" |
| | | style="width: 250px;"> |
| | | <a-date-picker v-model:value="formData.updateTime" show-time format="YYYY-MM-DD HH:mm:ss" |
| | | value-format="YYYY-MM-DD HH:mm:ss" /> |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_loc_detl.update_by', '修改人员')" name="updateBy" |
| | | style="width: 250px;"> |
| | | <a-select v-model:value="formData.updateBy" :placeholder="formatMessage('common.select', '请选择')" |
| | | style="width: 100%" show-search :options="userQueryList" optionFilterProp="label" |
| | | optionLabelProp="label"> |
| | | </a-select> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_loc_detl.memo', '备注') " |
| | | name="memo" |
| | | style="width: 250px;" |
| | | > |
| | | <a-input |
| | | v-model:value="formData.memo" |
| | | /> |
| | | </a-form-item> |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_loc_detl.memo', '备注')" name="memo" style="width: 250px;"> |
| | | <a-input v-model:value="formData.memo" /> |
| | | </a-form-item> |
| | | |
| | | <a-form-item v-for="(item, index) in extendField" :key="index" :label="formatMessage(item.language, item.describe)" :name="item.name" style="width: 250px;"> |
| | | <a-input v-model:value="formData[item.name]" /> |
| | | </a-form-item> |
| | | |
| | | <a-form-item> |
| | | <a-button type="primary" html-type="submit" ref="submitButton" |