| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <!-- 集采交易-我的集采-集采申请-价格编辑 -->
- <template>
- <app-drawer title="编辑" :width="400" v-model:show="show">
- <el-form ref="formRef" label-width="60px" :model="formItem" :rules="formRules">
- <el-form-item label="数量" prop="Qty">
- <el-input-number placeholder="请输入" v-model="formItem.Qty" />
- </el-form-item>
- <el-form-item label="价格" prop="Price">
- <el-input-number placeholder="请输入" v-model="formItem.Price" />
- </el-form-item>
- </el-form>
- <template #footer>
- <el-button @click="onCancel" plain>取消</el-button>
- <el-button type="primary" @click="onSubmit">保存</el-button>
- </template>
- </app-drawer>
- </template>
- <script lang="ts" setup>
- import { ref, PropType } from 'vue'
- import type { FormInstance, FormRules } from 'element-plus'
- import AppDrawer from '@pc/components/base/drawer/index.vue'
- const props = defineProps({
- selectedRow: {
- type: Object as PropType<Proto.GZCenterPurchasePrice>
- }
- })
- const emit = defineEmits(['update'])
- const show = ref(true)
- const formRef = ref<FormInstance>()
- const formItem = ref<Partial<Proto.GZCenterPurchasePrice>>({ StepIndex: 0, ...props.selectedRow })
- const formRules: FormRules = {
- Qty: [{
- required: true,
- message: '请输入数量'
- }],
- Price: [{
- required: true,
- message: '请输入价格'
- }],
- }
- const onCancel = () => {
- show.value = false
- }
- const onSubmit = () => {
- formRef.value?.validate((valid) => {
- if (valid) {
- emit('update', formItem.value)
- onCancel()
- }
- })
- }
- </script>
|