| | |
| | | <template> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <j-form-container :disabled="formDisabled"> |
| | | <j-form-container :disabled="formDisabled" class="andon-button-form"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> |
| | | <a-row> |
| | | <!-- 第一行:安灯名称 + 安灯编码 --> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="安灯名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="buttonName"> |
| | | <a-input v-model="model.buttonName" placeholder="请输入安灯名称" ></a-input> |
| | | <a-input v-model="model.buttonName" placeholder="请输入" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="安灯编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="buttonCode"> |
| | | <a-input v-model="model.buttonCode" placeholder="请输入安灯编码" ></a-input> |
| | | <a-input v-model="model.buttonCode" placeholder="请输入" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <!-- 第二行:升级响应时长 + 升级处理时长 --> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="升级响应" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="upgradeResponseDuration"> |
| | | <a-input-number v-model="model.upgradeResponseDuration" placeholder="请输入" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="升级响应时长(分钟)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="upgradeResponseDuration"> |
| | | <a-input-number v-model="model.upgradeResponseDuration" placeholder="请输入升级响应时长(分钟)" style="width: 100%" /> |
| | | <a-form-model-item label="升级处理" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="upgradeProcessDuration"> |
| | | <a-input-number v-model="model.upgradeProcessDuration" placeholder="请输入" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <!-- 第三行:二次升级响应时长 + 二次升级处理时长 --> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="二次升级响应" :labelCol="labelColWide" :wrapperCol="wrapperColNarrow" prop="secondUpgradeResponseDuration"> |
| | | <a-input-number v-model="model.secondUpgradeResponseDuration" placeholder="请输入" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="升级处理时长(分钟)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="upgradeProcessDuration"> |
| | | <a-input-number v-model="model.upgradeProcessDuration" placeholder="请输入升级处理时长(分钟)" style="width: 100%" /> |
| | | <a-form-model-item label="二次升级处理" :labelCol="labelColWide" :wrapperCol="wrapperColNarrow" prop="secondUpgradeProcessDuration"> |
| | | <a-input-number v-model="model.secondUpgradeProcessDuration" placeholder="请输入" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <!-- 第四行:安灯按钮状态 + 备注 --> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="二次升级响应时长(分钟)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="secondUpgradeResponseDuration"> |
| | | <a-input-number v-model="model.secondUpgradeResponseDuration" placeholder="请输入二次升级响应时长(分钟)" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="二次升级处理时长(分钟)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="secondUpgradeProcessDuration"> |
| | | <a-input-number v-model="model.secondUpgradeProcessDuration" placeholder="请输入二次升级处理时长(分钟)" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="安灯按钮状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="buttonStatus"> |
| | | <j-dict-select-tag type="list" v-model="model.buttonStatus" dictCode="button_status" placeholder="请选择安灯按钮状态" /> |
| | | <a-form-model-item label="按钮状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="buttonStatus"> |
| | | <j-dict-select-tag type="list" v-model="model.buttonStatus" dictCode="button_status" placeholder="请选择" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> |
| | | <a-input v-model="model.remark" placeholder="请输入备注" ></a-input> |
| | | <a-input v-model="model.remark" placeholder="请输入" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction, getAction } from '@/api/manage' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | |
| | | import { httpAction, getAction } from '@/api/manage' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | |
| | | export default { |
| | | name: 'AndonButtonConfigForm', |
| | | 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: { |
| | | buttonName: [ |
| | | { required: true, message: '安灯名称是必选项', trigger: 'change' } |
| | | ], |
| | | buttonCode: [ |
| | | { required: true, message: '安灯编码是必选项', trigger: 'change' } |
| | | ], |
| | | upgradeResponseDuration: [ |
| | | { required: true, message: '升级响应时长是必选项', trigger: 'change' } |
| | | ], |
| | | upgradeProcessDuration: [ |
| | | { required: true, message: '升级处理时长是必选项', trigger: 'change' } |
| | | ], |
| | | secondUpgradeResponseDuration: [ |
| | | { required: true, message: '二次升级响应时长是必选项', trigger: 'change' } |
| | | ], |
| | | secondUpgradeProcessDuration: [ |
| | | { required: true, message: '二次升级处理时长是必选项', trigger: 'change' } |
| | | ], |
| | | buttonStatus: [ |
| | | { required: true, message: '安灯按钮状态是必选项', trigger: 'change' } |
| | | ], |
| | | }, |
| | | url: { |
| | | add: "/andonbuttonconfig/andonButtonConfig/add", |
| | | edit: "/andonbuttonconfig/andonButtonConfig/edit", |
| | | queryById: "/andonbuttonconfig/andonButtonConfig/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: 'AndonButtonConfigForm', |
| | | components: {}, |
| | | props: { |
| | | disabled: { |
| | | type: Boolean, |
| | | default: false, |
| | | required: false |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | model: {}, |
| | | // 普通标签列宽度 |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 }, |
| | | }, |
| | | // 宽标签列(用于“二次升级响应”等长标签) |
| | | labelColWide: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 8 }, // 增加标签宽度 |
| | | }, |
| | | // 窄输入框列(配合宽标签,保持布局平衡) |
| | | wrapperColNarrow: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 18 }, |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | buttonName: [ |
| | | { required: true, message: '安灯名称是必选项', trigger: 'change' } |
| | | ], |
| | | buttonCode: [ |
| | | { required: true, message: '安灯编码是必选项', trigger: 'change' } |
| | | ], |
| | | upgradeResponseDuration: [ |
| | | { required: true, message: '升级响应时长是必选项', trigger: 'change' } |
| | | ], |
| | | upgradeProcessDuration: [ |
| | | { required: true, message: '升级处理时长是必选项', trigger: 'change' } |
| | | ], |
| | | secondUpgradeResponseDuration: [ |
| | | { required: true, message: '二次升级响应时长是必选项', trigger: 'change' } |
| | | ], |
| | | secondUpgradeProcessDuration: [ |
| | | { required: true, message: '二次升级处理时长是必选项', trigger: 'change' } |
| | | ], |
| | | buttonStatus: [ |
| | | { required: true, message: '安灯按钮状态是必选项', trigger: 'change' } |
| | | ], |
| | | }, |
| | | url: { |
| | | add: '/andonbuttonconfig/andonButtonConfig/add', |
| | | edit: '/andonbuttonconfig/andonButtonConfig/edit', |
| | | queryById: '/andonbuttonconfig/andonButtonConfig/queryById' |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | formDisabled() { |
| | | return this.disabled |
| | | }, |
| | | }, |
| | | created() { |
| | | 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; |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | } |
| | | </script> |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .andon-button-form { |
| | | padding: 24px; |
| | | background-color: #fff; |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); |
| | | } |
| | | |
| | | /* 统一表单项垂直间距 */ |
| | | .a-form-model-item { |
| | | margin-bottom: 16px !important; |
| | | } |
| | | |
| | | /* 标签与输入框水平间距(解决文字拥挤) */ |
| | | .a-form-model-item-label { |
| | | margin-right: 12px !important; |
| | | } |
| | | |
| | | /* 输入框 & 数字输入框 占位符样式优化 */ |
| | | .a-input::placeholder, |
| | | .a-input-number::placeholder { |
| | | color: #ccc; |
| | | font-style: italic; |
| | | } |
| | | |
| | | /* 必选标签的红色星号强调 */ |
| | | .a-form-model-item-label > span:first-child { |
| | | color: #f5222d; |
| | | margin-right: 2px; |
| | | } |
| | | |
| | | /* 按钮区域右对齐 & 按钮样式优化 */ |
| | | .a-form-footer { |
| | | text-align: right; |
| | | margin-top: 32px; |
| | | } |
| | | |
| | | .a-button-primary { |
| | | background-color: #1890ff; |
| | | border-color: #1890ff; |
| | | transition: all 0.3s ease; |
| | | } |
| | | |
| | | .a-button-primary:hover { |
| | | background-color: #40a9ff; |
| | | border-color: #40a9ff; |
| | | } |
| | | |
| | | .a-button-default { |
| | | border-color: #d9d9d9; |
| | | transition: all 0.3s ease; |
| | | } |
| | | |
| | | .a-button-default:hover { |
| | | border-color: #bfbfbf; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <j-form-container :disabled="formDisabled"> |
| | | <j-form-container :disabled="formDisabled" class="andon-order-form"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> |
| | | <a-row> |
| | | <a-col :span="24"> |
| | | <!-- 第一行:产线 + 安灯类型 --> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="产线" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryId"> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="" |
| | | > |
| | | <j-select-factory |
| | | :disabled="disabled" |
| | | v-model="model.factoryId" |
| | | :multi="true" |
| | | @back="backFactoryInfo" |
| | | :backProduction="true" |
| | | :treeProductOpera="true" |
| | | ></j-select-factory> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <j-select-factory |
| | | :disabled="disabled" |
| | | v-model="model.factoryId" |
| | | :multi="true" |
| | | @back="backFactoryInfo" |
| | | :backProduction="true" |
| | | :treeProductOpera="true" |
| | | ></j-select-factory> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="安灯类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="buttonId"> |
| | | <j-search-select-tag v-model="model.buttonId" placeholder="请输入安灯类型" |
| | | dict="andon_button_config,button_name,id"></j-search-select-tag> |
| | | <j-search-select-tag v-model="model.buttonId" placeholder="请输入安灯类型" dict="andon_button_config,button_name,id"></j-search-select-tag> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <!-- 第二行:安灯人 + 安灯时间 --> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="安灯人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator"> |
| | | <j-select-user-by-dep :multi="false" v-model="model.operator" placeholder="请输入安灯人" ></j-select-user-by-dep> |
| | | <j-select-user-by-dep :multi="false" v-model="model.operator" placeholder="请选择安灯人"></j-select-user-by-dep> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="安灯时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operateTime"> |
| | | <j-date placeholder="请选择安灯时间" v-model="model.operateTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" /> |
| | | <j-date placeholder="请选择安灯时间" v-model="model.operateTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <!-- 第三行:安灯等级 + 安灯状态 --> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="安灯等级" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="andonLevel"> |
| | | <j-dict-select-tag type="list" v-model="model.andonLevel" dictCode="andon_level" placeholder="请选择安灯等级" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <!-- <a-col :span="12">--> |
| | | <!-- <a-form-model-item label="响应人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="responder">--> |
| | | <!-- <j-select-user-by-dep v-model="model.responder" placeholder="请输入响应人" ></j-select-user-by-dep>--> |
| | | <!-- </a-form-model-item>--> |
| | | <!-- </a-col>--> |
| | | <!-- <a-col :span="12">--> |
| | | <!-- <a-form-model-item label="响应时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="responseTime">--> |
| | | <!-- <j-date placeholder="请选择响应时间" v-model="model.responseTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />--> |
| | | <!-- </a-form-model-item>--> |
| | | <!-- </a-col>--> |
| | | <!-- <a-col :span="12">--> |
| | | <!-- <a-form-model-item label="处理人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processor">--> |
| | | <!-- <j-select-user-by-dep v-model="model.processor" placeholder="请输入处理人" ></j-select-user-by-dep>--> |
| | | <!-- </a-form-model-item>--> |
| | | <!-- </a-col>--> |
| | | <!-- <a-col :span="12">--> |
| | | <!-- <a-form-model-item label="处理完成时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processTime">--> |
| | | <!-- <j-date placeholder="请选择处理完成时间" v-model="model.processTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />--> |
| | | <!-- </a-form-model-item>--> |
| | | <!-- </a-col>--> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="安灯状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderStatus"> |
| | | <j-dict-select-tag type="list" v-model="model.orderStatus" dictCode="order_status" placeholder="请选择安灯状态" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <!-- 第四行:问题描述 + 处理结果描述 --> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="问题描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="problemDescreption"> |
| | | <a-textarea v-model="model.problemDescreption" rows="4" placeholder="请输入问题描述" /> |
| | |
| | | <a-textarea v-model="model.resolutionDescreption" rows="4" placeholder="请输入处理结果描述" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <!-- 第五行:处理结果图片 --> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="处理结果图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="imageFiles"> |
| | | <j-image-upload isMultiple v-model="model.imageFiles" ></j-image-upload> |
| | | <j-image-upload isMultiple v-model="model.imageFiles"></j-image-upload> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction, getAction } from '@/api/manage' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | import JSelectFactory from '@comp/jeecgbiz/JSelectFactory.vue' |
| | | |
| | | import { httpAction, getAction } from '@/api/manage' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | import JSelectFactory from '@comp/jeecgbiz/JSelectFactory.vue' |
| | | |
| | | export default { |
| | | name: 'AndonOrderForm', |
| | | components: { |
| | | JSelectFactory |
| | | }, |
| | | 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: { |
| | | factoryId: [ |
| | | { required: true, message: '产线是必选项', trigger: 'change' } |
| | | ], |
| | | buttonId: [ |
| | | { required: true, message: '安灯类型是必选项', trigger: 'change' } |
| | | ], |
| | | operator: [ |
| | | { required: true, message: '安灯人是必选项', trigger: 'change' } |
| | | ], |
| | | operateTime: [ |
| | | { required: true, message: '安灯时间是必选项', trigger: 'change' } |
| | | ], |
| | | andonLevel: [ |
| | | { required: true, message: '安灯等级是必选项', trigger: 'change' } |
| | | ], |
| | | orderStatus: [ |
| | | { required: true, message: '安灯状态是必选项', trigger: 'change' } |
| | | ], |
| | | }, |
| | | url: { |
| | | add: "/andonorder/andonOrder/add", |
| | | edit: "/andonorder/andonOrder/edit", |
| | | queryById: "/andonorder/andonOrder/queryById" |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | formDisabled(){ |
| | | return this.disabled |
| | | }, |
| | | }, |
| | | created () { |
| | | //备份model原始值 |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
| | | }, |
| | | methods: { |
| | | backFactoryInfo(info) { |
| | | this.model.factoryIds = this.model.factoryId |
| | | this.nextFactoryOptions = info.map((item, index, arr) => { |
| | | let c = { label: item.text, value: item.value + '' } |
| | | return c |
| | | }) |
| | | }, |
| | | 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: 'AndonOrderForm', |
| | | components: { |
| | | JSelectFactory |
| | | }, |
| | | props: { |
| | | disabled: { |
| | | type: Boolean, |
| | | default: false, |
| | | required: false |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 }, // 调整标签宽度,更紧凑 |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | factoryId: [{ required: true, message: '产线是必选项', trigger: 'change' }], |
| | | buttonId: [{ required: true, message: '安灯类型是必选项', trigger: 'change' }], |
| | | operator: [{ required: true, message: '安灯人是必选项', trigger: 'change' }], |
| | | operateTime: [{ required: true, message: '安灯时间是必选项', trigger: 'change' }], |
| | | andonLevel: [{ required: true, message: '安灯等级是必选项', trigger: 'change' }], |
| | | orderStatus: [{ required: true, message: '安灯状态是必选项', trigger: 'change' }], |
| | | }, |
| | | url: { |
| | | add: '/andonorder/andonOrder/add', |
| | | edit: '/andonorder/andonOrder/edit', |
| | | queryById: '/andonorder/andonOrder/queryById' |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | formDisabled() { |
| | | return this.disabled |
| | | }, |
| | | }, |
| | | created() { |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
| | | }, |
| | | methods: { |
| | | backFactoryInfo(info) { |
| | | this.model.factoryIds = this.model.factoryId |
| | | this.nextFactoryOptions = info.map((item, index, arr) => { |
| | | let c = { label: item.text, value: item.value + '' } |
| | | return c |
| | | }) |
| | | }, |
| | | 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; |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | } |
| | | </script> |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .andon-order-form { |
| | | padding: 24px; |
| | | background-color: #fff; |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); |
| | | } |
| | | /* 统一表单项间距 */ |
| | | .a-form-model-item { |
| | | margin-bottom: 16px !important; |
| | | } |
| | | /* 调整文本域高度和占位符样式 */ |
| | | .a-textarea { |
| | | resize: vertical; |
| | | } |
| | | .a-textarea::placeholder { |
| | | color: #ccc; |
| | | } |
| | | /* 按钮区域右对齐 */ |
| | | .a-form-footer { |
| | | text-align: right; |
| | | margin-top: 24px; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <j-form-container :disabled="formDisabled"> |
| | | <j-form-container :disabled="formDisabled" class="andon-response-form"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> |
| | | <a-row> |
| | | <a-col :span="24"> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="产线" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryId"> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="" |
| | | > |
| | | <j-select-factory |
| | | :disabled="disabled" |
| | | v-model="model.factoryId" |
| | | :multi="true" |
| | | @back="backFactoryInfo" |
| | | :backProduction="true" |
| | | :treeProductOpera="true" |
| | | ></j-select-factory> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <j-select-factory |
| | | :disabled="disabled" |
| | | v-model="model.factoryId" |
| | | :multi="true" |
| | | @back="backFactoryInfo" |
| | | :backProduction="true" |
| | | :treeProductOpera="true" |
| | | ></j-select-factory> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="安灯类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="buttonId"> |
| | | <j-search-select-tag v-model="model.buttonId" placeholder="请输入安灯类型" |
| | | dict="andon_button_config,button_name,id"></j-search-select-tag> |
| | | <j-search-select-tag |
| | | v-model="model.buttonId" |
| | | placeholder="请选择" |
| | | dict="andon_button_config,button_name,id" |
| | | ></j-search-select-tag> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="初始响应人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="firsterResponder"> |
| | | <j-select-user-by-dep :multi="false" v-model="model.firsterResponder" placeholder="请输入初始响应人" ></j-select-user-by-dep> |
| | | <j-select-user-by-dep |
| | | :multi="false" |
| | | v-model="model.firsterResponder" |
| | | placeholder="请选择" |
| | | ></j-select-user-by-dep> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <!-- 二级响应人 + 三级响应人 --> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item |
| | | label="二级响应人" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="secondResponder" |
| | | > |
| | | <j-select-user-by-dep |
| | | :multi="false" |
| | | v-model="model.secondResponder" |
| | | placeholder="请选择" |
| | | ></j-select-user-by-dep> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="二级响应人(升级一次)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="secondResponder"> |
| | | <j-select-user-by-dep :multi="false" v-model="model.secondResponder" placeholder="请输入二级响应人(升级一次)" ></j-select-user-by-dep> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="三级响应人(升级两次)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="thirdResponder"> |
| | | <j-select-user-by-dep :multi="false" v-model="model.thirdResponder" placeholder="请输入三级响应人(升级两次)" ></j-select-user-by-dep> |
| | | <a-form-model-item |
| | | label="三级响应人" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | prop="thirdResponder" |
| | | > |
| | | <j-select-user-by-dep |
| | | :multi="false" |
| | | v-model="model.thirdResponder" |
| | | placeholder="请选择" |
| | | ></j-select-user-by-dep> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction } from '@/api/manage' |
| | | import JSelectFactory from '@comp/jeecgbiz/JSelectFactory.vue' |
| | | |
| | | import { httpAction, getAction } from '@/api/manage' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | import JSelectFactory from '@comp/jeecgbiz/JSelectFactory.vue' |
| | | export default { |
| | | name: 'AndonResponseConfigForm', |
| | | components: { |
| | | JSelectFactory |
| | | }, |
| | | 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: { |
| | | factoryId: [ |
| | | { required: true, message: '产线是必选项', trigger: 'change' } |
| | | ], |
| | | buttonId: [ |
| | | { required: true, message: '安灯类型是必选项', trigger: 'change' } |
| | | ], |
| | | firsterResponder: [ |
| | | { required: true, message: '初始响应人是必选项', trigger: 'change' } |
| | | ], |
| | | secondResponder: [ |
| | | { required: true, message: '二级响应人是必选项', trigger: 'change' } |
| | | ], |
| | | thirdResponder: [ |
| | | { required: true, message: '三级响应人是必选项', trigger: 'change' } |
| | | ], |
| | | }, |
| | | url: { |
| | | add: "/andonresponseconfig/andonResponseConfig/add", |
| | | edit: "/andonresponseconfig/andonResponseConfig/edit", |
| | | queryById: "/andonresponseconfig/andonResponseConfig/queryById" |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | formDisabled(){ |
| | | return this.disabled |
| | | }, |
| | | }, |
| | | created () { |
| | | //备份model原始值 |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
| | | }, |
| | | methods: { |
| | | backFactoryInfo(info) { |
| | | this.model.factoryIds = this.model.factoryId |
| | | this.nextFactoryOptions = info.map((item, index, arr) => { |
| | | let c = { label: item.text, value: item.value + '' } |
| | | return c |
| | | }) |
| | | }, |
| | | 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: 'AndonResponseConfigForm', |
| | | components: { |
| | | JSelectFactory |
| | | }, |
| | | props: { |
| | | disabled: { |
| | | type: Boolean, |
| | | default: false, |
| | | required: false |
| | | } |
| | | }, |
| | | data () { |
| | | return { |
| | | model: {}, |
| | | // 统一标签列宽度(产线、安灯类型等共用) |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 }, |
| | | }, |
| | | // 统一输入框列宽度 |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 18 }, |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | factoryId: [ |
| | | { required: true, message: '产线是必选项', trigger: 'change' } |
| | | ], |
| | | buttonId: [ |
| | | { required: true, message: '安灯类型是必选项', trigger: 'change' } |
| | | ], |
| | | firsterResponder: [ |
| | | { required: true, message: '初始响应人是必选项', trigger: 'change' } |
| | | ], |
| | | secondResponder: [ |
| | | { required: true, message: '二级响应人是必选项', trigger: 'change' } |
| | | ], |
| | | thirdResponder: [ |
| | | { required: true, message: '三级响应人是必选项', trigger: 'change' } |
| | | ], |
| | | }, |
| | | url: { |
| | | add: "/andonresponseconfig/andonResponseConfig/add", |
| | | edit: "/andonresponseconfig/andonResponseConfig/edit", |
| | | queryById: "/andonresponseconfig/andonResponseConfig/queryById" |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | formDisabled(){ |
| | | return this.disabled |
| | | }, |
| | | }, |
| | | created () { |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
| | | }, |
| | | methods: { |
| | | backFactoryInfo(info) { |
| | | this.model.factoryIds = this.model.factoryId |
| | | this.nextFactoryOptions = info.map((item, index, arr) => { |
| | | let c = { label: item.text, value: item.value + '' } |
| | | return c |
| | | }) |
| | | }, |
| | | 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; |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | } |
| | | </script> |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .andon-response-form { |
| | | padding: 24px; |
| | | background-color: #fff; |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); |
| | | } |
| | | .a-form-model-item { |
| | | margin-bottom: 20px !important; |
| | | } |
| | | .a-form-model-item-label { |
| | | margin-right: 16px !important; |
| | | } |
| | | .a-input::placeholder, |
| | | .a-select-selection-placeholder { |
| | | color: #ccc; |
| | | font-style: italic; |
| | | } |
| | | .a-form-model-item-label > span:first-child { |
| | | color: #f5222d; |
| | | margin-right: 4px; |
| | | } |
| | | .a-form-footer { |
| | | text-align: right; |
| | | margin-top: 36px; |
| | | } |
| | | .a-button-primary { |
| | | background-color: #1890ff; |
| | | border-color: #1890ff; |
| | | transition: all 0.3s ease; |
| | | } |
| | | .a-button-primary:hover { |
| | | background-color: #40a9ff; |
| | | border-color: #40a9ff; |
| | | } |
| | | .a-button-default { |
| | | border-color: #d9d9d9; |
| | | transition: all 0.3s ease; |
| | | } |
| | | .a-button-default:hover { |
| | | border-color: #bfbfbf; |
| | | } |
| | | </style> |