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/DeviceCustomTypeManagement/DeviceCustomTypeManagementModal.vue | 223 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 223 insertions(+), 0 deletions(-) diff --git a/src/views/dnc/base/modules/DeviceCustomTypeManagement/DeviceCustomTypeManagementModal.vue b/src/views/dnc/base/modules/DeviceCustomTypeManagement/DeviceCustomTypeManagementModal.vue new file mode 100644 index 0000000..02fe64d --- /dev/null +++ b/src/views/dnc/base/modules/DeviceCustomTypeManagement/DeviceCustomTypeManagementModal.vue @@ -0,0 +1,223 @@ +<template> + <a-modal + :title="title" + :width="700" + @cancel="close" + :visible="visible" + :footer="null" + style="height: 100%;overflow: auto;padding-bottom: 53px;"> + + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :form="form" :model="model" :rules="validatorRules" :labelCol="labelCol" + :wrapperCol="wrapperCol"> + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item label="杞﹂棿鍒嗛厤" prop="productionId"> + <a-select v-model="model.productionId" placeholder="璇烽�夋嫨杞﹂棿" @change="handleSelectChange" + :disabled="disabledEdit"> + <a-select-option v-for="item in workshopTreeData" :key="item.id"> + {{ item.productionName }} + </a-select-option> + </a-select> + </a-form-model-item> + </a-col> + + <a-col :span="12"> + <a-form-model-item label="杞存暟" prop="deviceManagementCode"> + <a-input allow-clear placeholder="璇疯緭鍏ヨ酱鏁�" :readOnly="disabledEdit" + v-model="model.deviceManagementCode"/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="12"> + <a-form-model-item label="鏁版帶绯荤粺绫诲埆" prop="deviceManagementName"> + <a-input allow-clear placeholder="璇疯緭鍏ユ暟鎺х郴缁熺被鍒�" :readOnly="disabledEdit" + v-model="model.deviceManagementName"/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-model-item label="璁惧缁勭紪鍙�" :labelCol="labelColLong" :wrapperCol="wrapperColLong" + prop="equipmentIds"> + <a-input-search v-model="model.equipmentIds" :disabled="!model.productionId" @search="deviceSearch" + enter-button :placeholder='!model.productionId?"璇烽�夋嫨杞﹂棿":"璇烽�夋嫨璁惧缁勭紪鍙�"'/> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </a-spin> + + + <div class="drawer-bottom-button"> + <a-space> + <a-button @click="close">鍙栨秷</a-button> + <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">鎻愪氦</a-button> + </a-space> + </div> + + <workshop-device-list-modal :productionId="model.productionId" ref="deviceListModel" + @sendSelectedRowKeys="getDeviceRowKeys"/> + </a-modal> +</template> + +<script> +import { httpAction } from '@/api/manage' +import WorkshopDeviceListModal from '@views/dnc/base/modules/DeviceCustomTypeManagement/WorkshopDeviceListModal.vue' + +export default { + name: 'DeviceCustomTypeManagementModal', + components: { WorkshopDeviceListModal }, + props: { + workshopTreeData: { + type: Array + } + }, + data() { + return { + title: '', + form: this.$form.createForm(this), + validatorRules: { + productionId: [ + { + required: true, message: '璇烽�夋嫨杞﹂棿!' + } + ], + deviceManagementCode: [ + { + required: true, message: '璇疯緭鍏ヨ酱鏁�!' + } + ], + deviceManagementName: [ + { + required: true, message: '璇疯緭鍏ユ暟鎺х郴缁熺被鍒�!' + } + ], + equipmentIds: [ + { + required: true, message: '璇烽�夋嫨璁惧缂栧彿!' + } + ] + }, + visible: false, + disabledEdit: false, + model: {}, + 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, + url: { + add: '/nc/deviceManagement/add', + edit: '/nc/deviceManagement/edit' + } + } + }, + methods: { + // 杞﹂棿閫夋嫨鍣ㄥ�煎彂鐢熸敼鍙樻椂瑙﹀彂娓呯┖宸查�夋嫨鐨勮澶囩紪鍙风粍 + handleSelectChange() { + if (this.model.equipmentIds) delete this.model.equipmentIds + }, + + /** + * 褰撹澶囬�夋嫨瀹屾垚鍚庢彁浜ゅ皢宸查�夋嫨鐨勮澶囩紪鍙峰垪琛ㄤ互閫楀彿闅斿紑鎷嗗垎鍒板弬鏁颁腑 + * @param selectedRowKeys + */ + getDeviceRowKeys(selectedRowKeys) { + if (selectedRowKeys.length === 0) return + this.$set(this.model, 'equipmentIds', selectedRowKeys.join(',')) + this.$refs.form.clearValidate() + }, + + deviceSearch() { + this.$refs.deviceListModel.openPage() + this.$refs.deviceListModel.title = '閫夋嫨璁惧' + this.$refs.deviceListModel.disableSubmit = false + }, + + add() { + this.edit({}) + }, + + edit(record) { + this.visible = true + this.model = Object.assign({}, record) + }, + + handleSubmit() { + const that = this + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true + let apiUrl, method + if (!this.model.id) { + apiUrl = this.url.add + method = 'post' + } else { + apiUrl = this.url.edit + method = 'put' + } + httpAction(apiUrl, this.model, method) + .then((res) => { + if (res.success) { + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.$emit('ok') + that.close() + } else { + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + .finally(() => { + that.confirmLoading = false + }) + } else { + return false + } + }) + }, + + close() { + this.$emit('close') + this.visible = false + this.$refs.form.clearValidate() + } + } + +} +</script> + +<style scoped> +.drawer-bottom-button { + position: absolute; + bottom: -40px; + width: 100%; + border-top: 1px solid #e8e8e8; + padding: 10px 16px; + text-align: right; + left: 0; + background: #fff; + border-radius: 0 0 2px 2px; +} +</style> \ No newline at end of file -- Gitblit v1.9.3