zhangwencui
6 天以前 a54ac80a89efee9823a9f4b9e1f66bec1a0d3eac
src/views/basicData/product/index.vue
@@ -408,16 +408,21 @@
  proxy.$refs.modelFormRef.validate((valid) => {
    if (valid) {
      let _modelForm = { ...modelForm.value };
      if(_modelForm.otherModel){
        _modelForm.model = _modelForm.otherModel;
      }
      delete _modelForm.otherModel;
      // 将选中的机器数组转换为逗号分隔的字符串
      // 确保 speculativeTradingName 是数组类型,然后转换为逗号分隔的字符串
      let speculativeTradingNameValue = modelForm.value.speculativeTradingName;
      if (!Array.isArray(speculativeTradingNameValue)) {
        // 如果不是数组,转换为数组
        speculativeTradingNameValue = speculativeTradingNameValue.split(',').filter(item => item);
      }
      const submitData = {
        ..._modelForm,
        productId: currentId.value,
        speculativeTradingName: modelForm.value.speculativeTradingName.join(',')
        speculativeTradingName: speculativeTradingNameValue.join(',')
      };
      addOrEditProductModel(submitData).then((res) => {
        proxy.$modal.msgSuccess("提交成功");