From 6bbceeae0a692ef60f429dbca889752fcb09ec9a Mon Sep 17 00:00:00 2001 From: houshuai <17802598606@163.com> Date: 星期四, 03 七月 2025 19:42:01 +0800 Subject: [PATCH] 线边库和订单 基本页面搭建 --- src/views/pms/modules/PmsProcessBillMaterialsForm.vue | 144 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 144 insertions(+), 0 deletions(-) diff --git a/src/views/pms/modules/PmsProcessBillMaterialsForm.vue b/src/views/pms/modules/PmsProcessBillMaterialsForm.vue new file mode 100644 index 0000000..68e2d88 --- /dev/null +++ b/src/views/pms/modules/PmsProcessBillMaterialsForm.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="orderId"> + <a-input v-model="model.orderId" placeholder="璇疯緭鍏ョ敓鎴愯鍗旾D" ></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="BOM浠g爜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="billMaterialsCode"> + <a-input v-model="model.billMaterialsCode" placeholder="璇疯緭鍏OM浠g爜" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鍩烘湰鍗曚綅" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productionUnit"> + <a-input v-model="model.productionUnit" placeholder="璇疯緭鍏ュ熀鏈崟浣�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="璁㈠崟鏁伴噺" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productionQuantity"> + <a-input-number v-model="model.productionQuantity" placeholder="璇疯緭鍏ヨ鍗曟暟閲�" 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: 'PmsProcessBillMaterialsForm', + 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: { + orderId: [ + { required: true, message: '鐢熸垚璁㈠崟鏄繀閫夐」', trigger: 'change' } + ], + materialNumber: [ + { required: true, message: '鐗╂枡缂栫爜鏄繀濉」', trigger: 'change' } + ], + materialName: [ + { required: true, message: '鐗╂枡鍚嶇О鏄繀濉」', trigger: 'change' } + ], + productionUnit: [ + { required: true, message: '鍩烘湰鍗曚綅鏄繀濉」', trigger: 'change' } + ], + productionQuantity: [ + { required: true, message: '璁㈠崟鏁伴噺鏄繀濉」', trigger: 'change' } + ], + }, + url: { + add: "/pmsprocessbillmaterials/pmsProcessBillMaterials/add", + edit: "/pmsprocessbillmaterials/pmsProcessBillMaterials/edit", + queryById: "/pmsprocessbillmaterials/pmsProcessBillMaterials/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