From ba77fdc6a30c9ad0941e40319f8c4f6fe6fdf9f1 Mon Sep 17 00:00:00 2001 From: cuilei <ray_tsu1@163.com> Date: 星期四, 07 八月 2025 10:30:42 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/pms/modules/PmsProcessBillMaterialsForm.vue | 161 +++++++++++++++++------------------------------------ 1 files changed, 53 insertions(+), 108 deletions(-) diff --git a/src/views/pms/modules/PmsProcessBillMaterialsForm.vue b/src/views/pms/modules/PmsProcessBillMaterialsForm.vue index 68e2d88..cc12488 100644 --- a/src/views/pms/modules/PmsProcessBillMaterialsForm.vue +++ b/src/views/pms/modules/PmsProcessBillMaterialsForm.vue @@ -4,33 +4,28 @@ <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 label="璁㈠崟鍙�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderCode"> + <a-input v-model="model.orderCode"></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-input v-model="model.materialNumber"></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-input v-model="model.materialName"></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-input v-model="model.productionUnit"></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-input-number v-model="model.productionQuantity" style="width: 100%" /> </a-form-model-item> </a-col> </a-row> @@ -41,104 +36,54 @@ <script> - import { httpAction, getAction } from '@/api/manage' - import { validateDuplicateValue } from '@/utils/util' +import { httpAction } from '@/api/manage' - 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; - }) - } - - }) - }, +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: { + }, + url: { + } + } + }, + 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 + }, } +} </script> \ No newline at end of file -- Gitblit v1.9.3