| | |
| | | <Plus /> |
| | | </el-icon>新增 |
| | | </el-button> |
| | | <el-button v-if="editable" |
| | | <!-- <el-button v-if="editable" |
| | | type="primary" |
| | | link |
| | | size="small" |
| | |
| | | <el-icon> |
| | | <Refresh /> |
| | | </el-icon>同步工序参数 |
| | | </el-button> |
| | | </el-button> --> |
| | | </div> |
| | | </div> |
| | | <div class="params-list"> |
| | |
| | | </el-form-item> |
| | | <el-form-item label="标准值"> |
| | | <el-input v-model="selectedParam.standardValue" |
| | | @input="val => onStandardValueInput(val, selectedParam)" |
| | | placeholder="请输入默认值" /> |
| | | </el-form-item> |
| | | <el-form-item label="是否必填"> |
| | |
| | | </div> |
| | | </div> |
| | | <template #footer> |
| | | <el-button @click="selectParamDialogVisible = false">取消</el-button> |
| | | <el-button type="primary" |
| | | @click="handleParamSelectSubmit">确定</el-button> |
| | | <el-button @click="selectParamDialogVisible = false">取消</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- 编辑参数对话框 --> |
| | |
| | | <el-form-item label="标准值" |
| | | prop="standardValue"> |
| | | <el-input v-model="editParamForm.standardValue" |
| | | @input="val => onStandardValueInput(val, editParamForm)" |
| | | placeholder="请输入标准值" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <el-button @click="editParamDialogVisible = false">取消</el-button> |
| | | <el-button type="primary" |
| | | @click="handleEditParamSubmit">确定</el-button> |
| | | <el-button @click="editParamDialogVisible = false">取消</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </el-dialog> |
| | |
| | | paramFormat: "", |
| | | unit: "", |
| | | }); |
| | | |
| | | const onStandardValueInput = (val, target) => { |
| | | const data = target.value || target; |
| | | const type = data.paramType || data.parameterType; |
| | | if (type === 1) { |
| | | // 数值格式:不能输入中文或英文字符 |
| | | data.standardValue = val.replace(/[a-zA-Z\u4e00-\u9fa5]/g, ""); |
| | | } |
| | | }; |
| | | |
| | | const editParamRules = ref({ |
| | | // standardValue: [{ required: true, message: "请输入标准值", trigger: "blur" }], |
| | | standardValue: [ |
| | | { |
| | | validator: (rule, value, callback) => { |
| | | const type = |
| | | editParamForm.value.paramType || editParamForm.value.parameterType; |
| | | if (type === 1 && value) { |
| | | if (/[a-zA-Z\u4e00-\u9fa5]/.test(value)) { |
| | | return callback(new Error("数值格式不能包含中英文字符")); |
| | | } |
| | | } |
| | | callback(); |
| | | }, |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }); |
| | | const editParamFormRef = ref(null); |
| | | |
| | |
| | | if (props.pageType === "order") { |
| | | addProcessRouteItemParamOrder({ |
| | | productionOrderId: Number(props.orderId), |
| | | productionOrderRoutingOperationId: props.process.id, |
| | | technologyRoutingOperationParamId: props.process.id, |
| | | paramId: selectedParam.value.id, |
| | | standardValue: selectedParam.value.standardValue || "", |
| | |
| | | id: editParamForm.value.id, |
| | | standardValue: editParamForm.value.standardValue || "", |
| | | isRequired: editParamForm.value.isRequired || 0, |
| | | // productionOrderRoutingOperationId: props.process.id, |
| | | }) |
| | | .then(res => { |
| | | if (res.code === 200) { |