From 61a19a514eed8796ee2c6e7ab1111addf053cf67 Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期三, 28 五月 2025 15:46:18 +0800 Subject: [PATCH] 1.新增NC文件批次页签 2.批次页签新增 数控加工确认表按钮,点击按钮出现对应批次确认表 3.处理修改查询电子样板与NC文件查询页面处理文件名折叠问题 --- src/views/dnc/base/modules/ProductStructure/Cutter/CutterModalForm.vue | 154 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 154 insertions(+), 0 deletions(-) diff --git a/src/views/dnc/base/modules/ProductStructure/Cutter/CutterModalForm.vue b/src/views/dnc/base/modules/ProductStructure/Cutter/CutterModalForm.vue new file mode 100644 index 0000000..11718fe --- /dev/null +++ b/src/views/dnc/base/modules/ProductStructure/Cutter/CutterModalForm.vue @@ -0,0 +1,154 @@ +<template> + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-row> + <a-col :span="12"> + <a-form-model-item label="鍒�鍏风紪鍙�"> + <a-input v-model="model.cutterCode" placeholder="璇疯緭鍏ュ垁鍏风紪鍙�" :readOnly="disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鍒�鍏峰悕绉�" prop="cutterName"> + <a-input v-model="model.cutterName" placeholder="璇疯緭鍏ュ垁鍏峰悕绉�" :readOnly="disableSubmit"/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row> + <a-col :span="12"> + <a-form-model-item label="鍒�鍏风畝绉�" prop="cutterType"> + <a-input v-model="model.cutterType" placeholder="璇疯緭鍏ュ垁鍏风畝绉�" :readOnly="disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="棰濆畾瀵垮懡"> + <a-input-number v-model="model.lifetime" :min="0" placeholder="璇疯緭鍏ラ瀹氬鍛�" style="width: 100%" + :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row> + <a-col :span="12"> + <a-form-model-item label="鍒�浣�" prop="cutterSpacing"> + <a-input v-model="model.cutterSpacing" placeholder="璇疯緭鍏ュ垁浣�" :readOnly="disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鍒�鍏锋暟閲�"> + <a-input-number v-model="model.quantity" placeholder="璇疯緭鍏ュ垁鍏锋暟閲�" :min="1" style="width: 100%" + :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row> + <a-col :span="24"> + <a-form-model-item label="鎻忚堪" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> + <a-textarea v-model="model.description" placeholder="璇疯緭鍏ユ弿杩�" :readOnly="disableSubmit"/> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </a-spin> +</template> + +<script> +import { httpAction } from '@/api/manage' + +export default { + name: 'CutterModalForm', + components: {}, + props: { + disableSubmit: { + type: Boolean + } + }, + data() { + return { + model: { + quantity: 1 + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 8 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 14 } + }, + labelColLong: { + xs: { span: 24 }, + sm: { span: 4 } + }, + wrapperColLong: { + xs: { span: 24 }, + sm: { span: 19 } + }, + confirmLoading: false, + validatorRules: { + cutterType: [ + { required: true, message: '璇疯緭鍏ュ垁鍏风畝绉�!' } + ], + cutterName: [ + { required: true, message: '璇疯緭鍏ュ垁鍏峰悕绉�!' } + ], + cutterSpacing: [ + { required: true, message: '璇疯緭鍏ュ垁浣�!' } + ] + }, + url: { + add: '/nc/cutter/add', + edit: '/nc/cutter/edit' + } + } + }, + created() { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)) + }, + methods: { + add(params) { + this.edit({ ...this.modelDefault, ...params }) + }, + edit(record) { + this.model = Object.assign({}, record) + console.log('model', this.model) + }, + submitForm() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true + let httpUrl, 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.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.$emit('ok') + } else { + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + that.confirmLoading = false + }) + } + + }) + } + } +} +</script> \ No newline at end of file -- Gitblit v1.9.3