haoxuan
2024-04-18 4959a25a7cac2a514a9b8fb2471101c067fd72e4
产品 启用多单位的时候如果没有设置显示弹框
3个文件已修改
31 ■■■■■ 已修改文件
src/views/productManage/product/AddProductDialog.vue 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productManage/product/components/UnitMoreDialog.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productManage/product/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productManage/product/AddProductDialog.vue
@@ -615,6 +615,7 @@
      ref="unitMoreDialog"
      @saveUnitMore="saveUnitMore"
      :workList="unitList"
      :unitRight='editConfig.infomation.unit'
      :dataList="editConfig.infomation.moreUnitList"
      title="启用多单位"
    ></UnitMoreDialog>
@@ -820,18 +821,25 @@
    // 启用多单位的开关
    moreUnitChange(){
      let string=false;
      if(this.editConfig.infomation.moreUnitList&&this.editConfig.infomation.moreUnitList.length>0){
        for(let i in this.editConfig.infomation.moreUnitList){
          if(this.editConfig.infomation.moreUnitList[i].unit&&this.editConfig.infomation.moreUnitList[i].amount){
            string=true;
            break;
      if(this.editConfig.infomation.unit){
        if(this.editConfig.infomation.moreUnitList&&this.editConfig.infomation.moreUnitList.length>0){
          for(let i in this.editConfig.infomation.moreUnitList){
            if(this.editConfig.infomation.moreUnitList[i].unit&&this.editConfig.infomation.moreUnitList[i].amount){
              string=true;
              break;
            }
          }
        }
      }
      if(!string){
        if(!string){
          this.editConfig.infomation.moreUnit=false
          this.$message.error('请先配置多单位!')
          this.$refs.unitMoreDialog.editDialogVisible = true;
        }
      }else{
        this.editConfig.infomation.moreUnit=false
        this.$message.error('请先配置多单位!')
        this.$message.error('请先选择单位!')
      }
    },
    handleConfirmSave(dataList) {
      saveUnitDict({ data: dataList }).then((res) => {
src/views/productManage/product/components/UnitMoreDialog.vue
@@ -72,7 +72,7 @@
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="2" class="col-name">包</el-col>
            <el-col :span="2" class="col-name">{{unitRight||'--'}}</el-col>
            <el-col :span="5" v-if="index==0"> 
              <el-form-item
                label=""
@@ -122,6 +122,9 @@
    workList: {
      type: [Array],
    },
    unitRight:{
      type: String,
    },
  },
  data() {
    return {
src/views/productManage/product/index.vue
@@ -311,7 +311,7 @@
      this.editConfig.autoEdit = true
      this.editConfig.title = "编辑"
      let imageSrc = row.attachmentList?.length > 0 ? row.attachmentList[0].FileUrl : ""
      this.editConfig.infomation = { ...row, imageSrc: imageSrc }
      this.editConfig.infomation = { ...row, imageSrc: imageSrc,moreUnitList:row.moreUnitList?row.moreUnitList:[] }
      this.editConfig.visible = true
    },
    // 切换列表展现形式