From 552be0f3f2b1b1ffc62a1d888e4c7b825fedb9dd Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期二, 13 五月 2025 10:31:14 +0800 Subject: [PATCH] 产品结构树工序和工步层级新增导入其他文档功能 --- src/views/dnc/base/modules/ProductStructure/Cutter/CutterModalForm.vue | 152 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 152 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..3c5c2c9 --- /dev/null +++ b/src/views/dnc/base/modules/ProductStructure/Cutter/CutterModalForm.vue @@ -0,0 +1,152 @@ +<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="鍒�鍏风紪鍙�" prop="cutterCode"> + <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="鍒�鍏风被鍨�"> + <j-dict-select-tag v-model="model.cutterType" placeholder="璇烽�夋嫨鍒�鍏风被鍨�" dictCode="cutter_type" + :disabled="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="鍒�浣�"> + <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: { + cutterCode: [ + { required: true, message: '璇疯緭鍏ュ垁鍏风紪鍙�!' } + ], + cutterName: [ + { 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