yangfeng
2024-01-09 36599eb356a979115a7f7134861f076a75f0f84a
新建产品-产品负责人设置默认值和不可点击及新增接口
2个文件已修改
33 ■■■■ 已修改文件
src/api/common/other.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productManage/product/AddProductDialog.vue 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/common/other.js
@@ -32,3 +32,11 @@
    data
  })
}
// 获取登录用户信息
export const getUserInfo = (data) => {
  return request({
    url: "/api-wms/v1/product/getUserInfo",
    method: "get",
    params: data
  })
}
src/views/productManage/product/AddProductDialog.vue
@@ -282,9 +282,14 @@
                      placeholder="请选择"
                      size="mini"
                      style="width: 85%"
                      :disabled="!showFooter"
                      disabled
                    >
                      <el-option v-for="item in memberOptions" :key="item.id" :label="item.name" :value="item.name">
                      <el-option
                        v-for="(item, index) in memberOptions"
                        :key="index"
                        :label="item.userName"
                        :value="item.userName"
                      >
                      </el-option>
                    </el-select>
                  </el-form-item>
@@ -512,7 +517,7 @@
import IconCropper from "./IconCropper"
import { getProductCategoryList } from "@/api/product/productCategory"
import { getProductList, addProduct, updateProduct } from "@/api/product/product"
import { uploadFiles } from "@/api/common/other"
import { uploadFiles, getUserInfo } from "@/api/common/other"
import codeMixin from "@/components/mixin/codeMixin"
import { getDataByType } from "@/api/data"
export default {
@@ -556,7 +561,7 @@
        // 采购类型
        purchaseType: [{ required: true, message: "请选择", trigger: "blur" }]
      },
      memberOptions: [{ name: "管理员", id: 1 }],
      memberOptions: [],
      productCategoryOptions: [], // 产品类别
      productTypeOptions: [
        { name: "能消耗", id: 1 },
@@ -631,8 +636,20 @@
    }
    this.setOptionalFieldsToEmpty()
    this.formInfo()
    this.getUserInfo()
  },
  methods: {
    // 获取登录用户信息
    getUserInfo() {
      getUserInfo().then((res) => {
        console.log(res)
        if (res.code == 200) {
          this.editConfig.infomation.principal = res.data.userName
          this.memberOptions.push(res.data)
        }
        console.log(this.memberOptions)
      })
    },
    formInfo() {
      this.objCode.type = "物料编码"
      this.objCode.codeStandID = ""