浏览代码

仓库维护改可多选

cz 1 年之前
父节点
当前提交
c46dbe2a91
共有 1 个文件被更改,包括 10 次插入2 次删除
  1. 10 2
      src/views/purchaseSales/warehouseConfig/warehouse/index.vue

+ 10 - 2
src/views/purchaseSales/warehouseConfig/warehouse/index.vue

@@ -197,6 +197,7 @@ const formConfig = reactive([
     type: "select",
     prop: "type",
     label: "仓库类型",
+
     required: true,
     data: [],
   },
@@ -209,6 +210,7 @@ const formConfig = reactive([
     type: "select",
     prop: "keeperId",
     label: "仓管员",
+    multiple: true,
     isLoad: {
       url: `/tenantUser/list?pageNum=1&pageSize=9999&tenantId=${
         useUserStore().user.tenantId
@@ -241,14 +243,18 @@ const getList = async (req) => {
 const openModal = () => {
   dialogVisible.value = true;
   modalType.value = "add";
-  formData.data = {};
+  formData.data = {
+    keeperId: [],
+  };
 };
 
 const submitForm = () => {
   console.log(byform.value);
   byform.value.handleSubmit((valid) => {
     submitLoading.value = true;
-    proxy.post("/warehouse/" + modalType.value, formData.data).then(
+    const submitData = { ...formData.data };
+    submitData.keeperId = submitData.keeperId.join(",");
+    proxy.post("/warehouse/" + modalType.value, submitData).then(
       (res) => {
         ElMessage({
           message: modalType.value == "add" ? "添加成功" : "编辑成功",
@@ -267,10 +273,12 @@ const getDtl = (row) => {
   modalType.value = "edit";
   proxy.post("/warehouse/detail", { id: row.id }).then((res) => {
     res.type = res.type + "";
+    res.keeperId = res.keeperId.split(",");
     dialogVisible.value = true;
     formData.data = res;
   });
 };
+
 const warehouseType = ref([]);
 const getDict = () => {
   // // 币种数据