fill.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <a-modal v-model:visible="visible" title="填报">
  3. <a-form ref="formRef" :label-col="labelCol" :model="formData" layout="horizontal">
  4. <a-form-item v-show="false">
  5. <a-input v-model:value="formData.id"></a-input>
  6. </a-form-item>
  7. <a-form-item
  8. label="起卸数量"
  9. name="fillWeight"
  10. >
  11. <!-- <a-textarea v-model:value="formData.endReason" placeholder="请输入结束说明"
  12. :auto-size="{ minRows: 3, maxRows: 5 }"/>-->
  13. <a-input-number v-model:value="formData.fillWeight" style="width:90%" :precision="2" :min="0.01" :max="9999999" placeholder="请输入起卸数量" allow-clear/><span style="margin-left:10px;">吨</span>
  14. </a-form-item>
  15. </a-form>
  16. <template #footer>
  17. <a-spin :spinning="submitLoading">
  18. <a-button type="primary" @click="onsubmit(true)">确认</a-button>
  19. </a-spin>
  20. </template>
  21. </a-modal>
  22. </template>
  23. <script setup>
  24. import {message} from 'ant-design-vue';
  25. import bizOrderApi from '@/api/biz/bizOrderApi'
  26. import bizLoadAppointApi from "@/api/biz/bizLoadAppointApi";
  27. const emit = defineEmits({successful: null})
  28. const visible = ref(false);
  29. const submitLoading = ref(false)
  30. const labelCol = ref({span: 4})
  31. // 表单数据
  32. const formData = ref({})
  33. const showModal = (id) => {
  34. formData.value.id = id
  35. visible.value = true;
  36. };
  37. const onClose = () => {
  38. formData.value = {}
  39. visible.value = false
  40. };
  41. const onsubmit = (flag) => {
  42. if (flag === true) {
  43. if (!formData.value.fillWeight) {
  44. message.error('起卸数量不能为空')
  45. return
  46. }
  47. }
  48. submitLoading.value = true
  49. bizLoadAppointApi.fillLoad(formData.value).then(() => {
  50. onClose()
  51. emit('successful', null)
  52. }).finally(() => {
  53. submitLoading.value = false
  54. })
  55. }
  56. // 抛出函数
  57. defineExpose({
  58. showModal
  59. })
  60. </script>
  61. <style scoped>
  62. </style>