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/LswMaterialOutboundForm.vue | 144 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 144 insertions(+), 0 deletions(-) diff --git a/src/views/lsw/modules/LswMaterialOutboundForm.vue b/src/views/lsw/modules/LswMaterialOutboundForm.vue new file mode 100644 index 0000000..eebe46f --- /dev/null +++ b/src/views/lsw/modules/LswMaterialOutboundForm.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="鐗╂枡缂栫爜" :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="浜х嚎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="鎵规鍙�" :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="outboundStaff"> + <a-input v-model="model.outboundStaff" placeholder="璇疯緭鍏ュ嚭搴撲汉" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鍑哄簱鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="outboundTime"> + <j-date placeholder="璇烽�夋嫨鍑哄簱鏃堕棿" v-model="model.outboundTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" /> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鍑哄簱鏁伴噺" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="quantity"> + <a-input v-model="model.quantity" placeholder="璇疯緭鍏ュ嚭搴撴暟閲�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="宸ュ崟ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workOrderId"> + <a-input v-model="model.workOrderId" placeholder="璇疯緭鍏ュ伐鍗旾D" ></a-input> + </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: 'LswMaterialOutboundForm', + 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: "/lswmaterialoutbound/lswMaterialOutbound/add", + edit: "/lswmaterialoutbound/lswMaterialOutbound/edit", + queryById: "/lswmaterialoutbound/lswMaterialOutbound/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