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/mes/modules/MesProductionWorkOrderRepublishModal.vue | 132 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 132 insertions(+), 0 deletions(-) diff --git a/src/views/mes/modules/MesProductionWorkOrderRepublishModal.vue b/src/views/mes/modules/MesProductionWorkOrderRepublishModal.vue new file mode 100644 index 0000000..bf3160d --- /dev/null +++ b/src/views/mes/modules/MesProductionWorkOrderRepublishModal.vue @@ -0,0 +1,132 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + + <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="24"> + <a-form-model-item label="璁″垝鐢熶骇鏁伴噺" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planQuantity"> + <a-input-number + v-model="model.planQuantity" + placeholder="璇疯緭鍏ヨ鍒掔敓浜ф暟閲�" + style="width: 100%" + :min="0"> + </a-input-number> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item label="閲嶅彂甯冨師鍥�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="republishReason"> + <a-textarea + v-model="model.republishReason" + placeholder="璇峰~鍐欓噸鍙戝竷鍘熷洜" + :rows="4"> + </a-textarea> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> + </j-modal> +</template> + +<script> +import { postAction } from '@api/manage' + +export default { + name: 'MesProductionWorkOrderRepublishModal', + data () { + return { + title: '閲嶅彂甯冨伐鍗�', + width: 600, + visible: false, + disableSubmit: false, + confirmLoading: false, + model: { + id: '', + planQuantity: null, + republishReason: '' + }, + validatorRules: { + planQuantity: [ + { required: true, message: '璇疯緭鍏ヨ鍒掔敓浜ф暟閲�!' } + ], + republishReason: [ + { required: true, message: '璇峰~鍐欓噸鍙戝竷鍘熷洜!' } + ] + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 6 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 18 }, + }, + url: { + republish: '/mesproductionworkorder/mesProductionWorkOrder/republish' + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + methods: { + add (record) { + // 閲嶇疆琛ㄥ崟 + this.$refs.form && this.$refs.form.resetFields() + // 璁剧疆鍒濆鍊� + if (record) { + this.model.id = record.id + this.model.planQuantity = record.planQuantity + this.model.republishReason = '' + } + this.visible = true + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.form.validate(valid => { + if (valid) { + this.confirmLoading = true + let formData = { + id: this.model.id, + planQuantity: this.model.planQuantity, + republishReason: this.model.republishReason + } + postAction(this.url.republish, formData).then(res => { + if (res.success) { + this.$message.success(res.message) + this.submitCallback() + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.confirmLoading = false + }) + } + }) + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } +} +</script> -- Gitblit v1.9.3