From 4d5d871dd1cdc90cd1d913a0c696b7662b9d17e0 Mon Sep 17 00:00:00 2001
From: houshuai <17802598606@163.com>
Date: 星期一, 30 六月 2025 17:12:36 +0800
Subject: [PATCH] 线边库基本页面搭建

---
 src/views/lsw/modules/LswMaterialInboundForm.vue |  144 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 144 insertions(+), 0 deletions(-)

diff --git a/src/views/lsw/modules/LswMaterialInboundForm.vue b/src/views/lsw/modules/LswMaterialInboundForm.vue
new file mode 100644
index 0000000..80c577d
--- /dev/null
+++ b/src/views/lsw/modules/LswMaterialInboundForm.vue
@@ -0,0 +1,144 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row>
+          <a-col :span="12">
+            <a-form-model-item label="鍒犻櫎鏍囪" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag">
+              <a-input-number v-model="model.delFlag" placeholder="璇疯緭鍏ュ垹闄ゆ爣璁�" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item label="浜х嚎ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryId">
+              <a-input v-model="model.factoryId" placeholder="璇疯緭鍏ヤ骇绾縄D"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item label="搴撳瓨鍦癐D" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="warehouseId">
+              <a-input v-model="model.warehouseId" placeholder="璇疯緭鍏ュ簱瀛樺湴ID"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item label="鐗╂枡缂栫爜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialNumber">
+              <a-input v-model="model.materialNumber" placeholder="璇疯緭鍏ョ墿鏂欑紪鐮�"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item label="鐗╂枡鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialName">
+              <a-input v-model="model.materialName" placeholder="璇疯緭鍏ョ墿鏂欏悕绉�"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item label="鎵规鍙�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="batchNumber">
+              <a-input v-model="model.batchNumber" placeholder="璇疯緭鍏ユ壒娆″彿"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item label="鍏ュ簱鏁伴噺" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="quantity">
+              <a-input-number v-model="model.quantity" placeholder="璇疯緭鍏ュ叆搴撴暟閲�" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item label="鎺ユ敹浜�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiver">
+              <a-input v-model="model.receiver" placeholder="璇疯緭鍏ユ帴鏀朵汉"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item label="鎺ユ敹鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="receiveTime">
+              <j-date placeholder="璇烽�夋嫨鎺ユ敹鏃堕棿"  v-model="model.receiveTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'LswMaterialInboundForm',
+    components: {
+    },
+    props: {
+      //琛ㄥ崟绂佺敤
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+        },
+        url: {
+          add: "/lswmaterialinbound/lswMaterialInbound/add",
+          edit: "/lswmaterialinbound/lswMaterialInbound/edit",
+          queryById: "/lswmaterialinbound/lswMaterialInbound/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //澶囦唤model鍘熷鍊�
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 瑙﹀彂琛ㄥ崟楠岃瘉
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+
+        })
+      },
+    }
+  }
+</script>
\ No newline at end of file

--
Gitblit v1.9.3