Parcourir la source

维多利亚bug解决

cz il y a 2 ans
Parent
commit
9a00c881f0

+ 145 - 63
src/views/WDLY/basic/product/index.vue

@@ -86,52 +86,57 @@
             :rules="rules"
             style="margin-top: 15px"
           >
-            <el-form-item
-              label="组合明细"
+            <div
+              style="
+                font-size: 14px;
+                font-weight: bold;
+                margin-top: 22px;
+                color: #333333;
+              "
               v-show="formData.data.combination == 1"
             >
-              <el-button
-                type="primary"
-                @click="openProduct = true"
-                style="margin-bottom: 10px"
+              组合明细
+            </div>
+            <el-button
+              type="primary"
+              @click="openProduct = true"
+              style="margin-bottom: 10px"
+              v-show="formData.data.combination == 1"
+            >
+              添加
+            </el-button>
+            <el-table
+              :data="formData.data.productCombinationList"
+              v-show="formData.data.combination == 1"
+            >
+              <el-table-column prop="code" label="产品编码" />
+              <el-table-column prop="name" label="产品名称" />
+              <el-table-column
+                prop="linkQuantity"
+                label="组合数量"
+                min-width="150"
               >
-                添加
-              </el-button>
-              <el-table :data="formData.data.productCombinationList">
-                <el-table-column prop="code" label="产品编码" />
-                <el-table-column prop="name" label="产品名称" />
-                <el-table-column
-                  prop="linkQuantity"
-                  label="组合数量"
-                  min-width="150"
-                >
-                  <template #default="{ row, $index }">
-                    <el-form-item
-                      :prop="
-                        'productCombinationList.' + $index + '.linkQuantity'
-                      "
-                      :rules="rules.linkQuantity"
-                      :inline-message="true"
-                    >
-                      <el-input
-                        v-model="row.linkQuantity"
-                        placeholder="请输入"
-                      />
-                    </el-form-item>
-                  </template>
-                </el-table-column>
-                <el-table-column prop="zip" label="操作" width="100">
-                  <template #default="{ $index }">
-                    <el-button
-                      type="primary"
-                      link
-                      @click="handleRemoveProduct($index)"
-                      >删除</el-button
-                    >
-                  </template>
-                </el-table-column>
-              </el-table>
-            </el-form-item>
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="'productCombinationList.' + $index + '.linkQuantity'"
+                    :rules="rules.linkQuantity"
+                    :inline-message="true"
+                  >
+                    <el-input v-model="row.linkQuantity" placeholder="请输入" />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column prop="zip" label="操作" width="100">
+                <template #default="{ $index }">
+                  <el-button
+                    type="primary"
+                    link
+                    @click="handleRemoveProduct($index)"
+                    >删除</el-button
+                  >
+                </template>
+              </el-table-column>
+            </el-table>
           </el-form>
         </template>
         <template #one>
@@ -242,6 +247,28 @@
         </el-button>
       </template>
     </el-dialog>
+
+    <el-dialog title="移交" v-model="moveDept" width="400" v-loading="loading">
+      <div style="margin-bottom: 15px">请选择部门</div>
+      <el-tree-select
+        v-model="moveForm.deptId"
+        :data="deptList"
+        :render-after-expand="false"
+        check-strictly
+        :node-key="'deptId'"
+        :props="defaultProps"
+      />
+      <template #footer>
+        <el-button @click="moveDept = false">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="submitMove()"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
     <el-dialog
       v-model="openProduct"
       title="选择产品"
@@ -265,6 +292,7 @@ import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import treeList from "@/components/product/treeList";
 import SelectProduct from "@/components/WDLY/product/SelectProduct";
+import useUserStore from "@/store/modules/user";
 
 import { computed, defineComponent, ref } from "vue";
 let openProduct = ref(false);
@@ -285,6 +313,7 @@ const sourceList = ref({
 });
 let dialogVisible = ref(false);
 let openExcelDialog = ref(false);
+let moveDept = ref(false);
 
 let modalType = ref("add");
 let rules = ref({
@@ -435,6 +464,17 @@ const config = computed(() => {
           },
           {
             attrs: {
+              label: "移交",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtlOne(row);
+            },
+          },
+          {
+            attrs: {
               label: "删除",
               type: "danger",
               text: true,
@@ -595,11 +635,6 @@ const formConfig = computed(() => {
         },
       ],
     },
-    // {
-    //   type: "title",
-    //   title: "组合明细",
-    //   label: "",
-    // },
     {
       type: "slot",
       slotName: "combination",
@@ -677,7 +712,6 @@ const getList = async (req) => {
 };
 
 const treeChange = (e) => {
-  console.log(e);
   sourceList.value.pagination.productClassifyId = e.id;
   getList({ productClassifyId: e.id });
 };
@@ -723,24 +757,21 @@ const tree = ref(null);
 const submitForm = () => {
   byform.value.handleSubmit((valid) => {
     if (formData.data.combination == 1) {
-      if (!formData.data.productCombinationList.length > 0) {
+      if (!(formData.data.productCombinationList.length > 0)) {
         return ElMessage({
           message: "请添加组合明细",
           type: "info",
         });
       }
-      formData.data.victoriatouristJson = JSON.parse(
-        formData.data.victoriatouristJson
-      );
-      formData.data.victoriatouristJson.productCombinationList =
-        formData.data.productCombinationList;
-      formData.data.victoriatouristJson.combination = formData.data.combination;
-      delete formData.data.productCombinationList;
-      delete formData.data.combination;
-      formData.data.victoriatouristJson = JSON.stringify(
-        formData.data.victoriatouristJson
-      );
     }
+    formData.data.victoriatouristJson.productCombinationList =
+      formData.data.productCombinationList;
+    formData.data.victoriatouristJson.combination = formData.data.combination;
+    delete formData.data.productCombinationList;
+    delete formData.data.combination;
+    formData.data.victoriatouristJson = JSON.stringify(
+      formData.data.victoriatouristJson
+    );
     formData.data.fileList = fileListCopy.value.map((x) => ({
       id: x.id,
       fileName: x.fileName,
@@ -773,6 +804,22 @@ const getTreeList = () => {
       formConfig.value[0].data = message;
     });
 };
+const deptList = ref([]);
+const defaultProps = {
+  children: "children",
+  label: "deptName",
+};
+const getDept = () => {
+  proxy
+    .get("/tenantDept/list", {
+      pageNum: 1,
+      pageSize: 999,
+      tenantId: useUserStore().user.tenantId,
+    })
+    .then((res) => {
+      deptList.value = proxy.handleTree(res.data, "deptId");
+    });
+};
 
 const getDtl = (row) => {
   modalType.value = "edit";
@@ -781,14 +828,20 @@ const getDtl = (row) => {
     fileListCopy.value = [...fileList.value];
     res.type = res.type + ""; //type回显
     res.definition = "1"; //产品
-    res.victoriatouristJson = JSON.parse(res.victoriatouristJson);
-    res.combination = res.victoriatouristJson.combination + "";
+    res.victoriatouristJson = res.victoriatouristJson
+      ? JSON.parse(res.victoriatouristJson)
+      : {};
+    res.combination = res.victoriatouristJson.combination
+      ? res.victoriatouristJson.combination
+      : 0 + "";
     res.productCombinationList = res.victoriatouristJson.productCombinationList;
     formData.data = res;
     dialogVisible.value = true;
   });
 };
 getTreeList();
+getDept();
+
 getList();
 const handleBeforeUpload = async (file) => {
   const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
@@ -875,6 +928,35 @@ const handleSelect = (row) => {
     type: "success",
   });
 };
+let moveForm = ref({});
+let rowData = {};
+const getDtlOne = (row) => {
+  moveForm.value = {};
+  moveDept.value = true;
+  rowData = row;
+};
+
+const submitMove = () => {
+  if (!moveForm.value.deptId) {
+    return ElMessage({
+      message: "请选择部门!",
+      type: "info",
+    });
+  }
+  proxy
+    .post("/productInfo/transfer", {
+      id: rowData.id,
+      deptId: moveForm.value.deptId,
+    })
+    .then((res) => {
+      ElMessage({
+        message: "移交成功",
+        type: "success",
+      });
+      getList();
+      moveDept.value = false;
+    });
+};
 </script>
   
 <style lang="scss" scoped>

+ 8 - 2
src/views/WDLY/basic/spu/index.vue

@@ -49,7 +49,7 @@
               添加产品
             </el-button>
             <el-table :data="formData.data.productInfos">
-              <el-table-column prop="name" label="产品编码" min-width="150" />
+              <el-table-column prop="code" label="产品编码" min-width="150" />
               <el-table-column prop="name" label="产品名称" min-width="150" />
               <el-table-column prop="zip" label="操作" width="100">
                 <template #default="{ $index }">
@@ -143,7 +143,13 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "备注",
+        label: "关联产品数",
+        prop: "count",
+      },
+    },
+    {
+      attrs: {
+        label: "spu说明",
         prop: "remark",
       },
     },

+ 10 - 2
src/views/WDLY/basic/supplier/index.vue

@@ -439,17 +439,24 @@ const formConfig = computed(() => {
           label: "账期",
           itemWidth: 33,
           controls: false,
-          precision: 2,
+          precision: 0,
           style: {
             width: "100%",
             "margin-right": "10px",
+            "text-align": "left",
           },
         },
         {
-          type: "input",
+          type: "number",
           prop: "returnPeriod",
           label: "退换货期限",
           itemWidth: 33,
+          controls: false,
+          precision: 0,
+          style: {
+            width: "100%",
+            "text-align": "left",
+          },
         },
         {
           type: "input",
@@ -511,6 +518,7 @@ const openModal = () => {
   formData.data = {
     type: "1",
     countryId: "China",
+    victoriatouristJson: {},
   };
   getCityData(formData.data.countryId, "20");
 };

+ 200 - 98
src/views/WDLY/salesMange/jdOrder/index.vue

@@ -15,6 +15,11 @@
         }"
         :action-list="[
           {
+            text: 'Excel导入',
+            action: () => openExcel(),
+            disabled: false,
+          },
+          {
             text: '添加订单',
             action: () => openModal('add'),
           },
@@ -50,6 +55,19 @@
         :rules="rules"
         ref="byform"
       >
+        <template #distributionCenter>
+          <div>
+            <el-autocomplete
+              v-model="formData.data.distributionCenter"
+              :fetch-suggestions="querySearchPerson"
+              clearable
+              class="inline-input w-50"
+              placeholder="请输入"
+              @select="handlePerson"
+            >
+            </el-autocomplete>
+          </div>
+        </template>
         <template #address>
           <el-row style="width: 100%">
             <el-col :span="8">
@@ -118,13 +136,13 @@
             >
               添加物品
             </el-button>
-            <el-table :data="formData.data.orderDetailsList">
+            <el-table :data="formData.data.jdOrderDetailsList">
               <el-table-column prop="productCode" label="产品编码" />
               <el-table-column prop="productName" label="产品名称" />
               <el-table-column prop="price" label="单价" min-width="150">
                 <template #default="{ row, $index }">
                   <el-form-item
-                    :prop="'orderDetailsList.' + $index + '.price'"
+                    :prop="'jdOrderDetailsList.' + $index + '.price'"
                     :rules="rules.price"
                     :inline-message="true"
                   >
@@ -141,7 +159,7 @@
               <el-table-column prop="quantity" label="数量" min-width="150">
                 <template #default="{ row, $index }">
                   <el-form-item
-                    :prop="'orderDetailsList.' + $index + '.quantity'"
+                    :prop="'jdOrderDetailsList.' + $index + '.quantity'"
                     :rules="rules.quantity"
                     :inline-message="true"
                   >
@@ -159,7 +177,7 @@
               <el-table-column prop="remark" label="备注" min-width="200">
                 <template #default="{ row, $index }">
                   <el-form-item
-                    :prop="'orderDetailsList.' + $index + '.remark'"
+                    :prop="'jdOrderDetailsList.' + $index + '.remark'"
                     :rules="rules.remark"
                     :inline-message="true"
                   >
@@ -226,6 +244,47 @@
         </span>
       </template>
     </el-dialog>
+    <el-dialog
+      title="Excel导入"
+      v-model="openExcelDialog"
+      width="400"
+      v-loading="excelLoading"
+    >
+      <div style="margin-bottom: 10px">导入前请先选择客户</div>
+      <el-select v-model="importData.customerId" placeholder="请选择客户">
+        <el-option
+          v-for="item in warehouseList"
+          :key="item.id"
+          :label="item.name"
+          :value="item.id"
+        />
+      </el-select>
+      <div style="margin-top: 20px" v-show="importData.customerId">
+        <el-upload
+          action="/dev-api/jdOrder/excelImport"
+          :data="importData"
+          :headers="headers"
+          :on-success="handleSuccess"
+          :on-progress="handleProgress"
+          :show-file-list="false"
+          :on-error="handleError"
+          accept=".xlsx"
+        >
+          <el-button type="primary">点击导入</el-button>
+        </el-upload>
+      </div>
+
+      <template #footer>
+        <el-button @click="openExcelDialog = false">取 消</el-button>
+        <!-- <el-button
+          type="primary"
+          @click="submitExcel()"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button> -->
+      </template>
+    </el-dialog>
   </div>
 </template>
   
@@ -238,6 +297,8 @@ import { computed, defineComponent, ref } from "vue";
 import useUserStore from "@/store/modules/user";
 import SelectProduct from "@/components/WDLY/product/SelectProduct";
 import OrderDetails from "@/components/WDLY/order/details";
+import { getToken } from "@/utils/auth";
+const headers = ref({ Authorization: "Bearer " + getToken() });
 
 const loading = ref(false);
 const submitLoading = ref(false);
@@ -252,11 +313,12 @@ const sourceList = ref({
 let dialogVisible = ref(false);
 let openProduct = ref(false);
 let openDetails = ref(false);
-
+const importData = reactive({});
 let roomDialogVisible = ref(false);
+let excelLoading = ref(false);
 let modalType = ref("add");
 let rules = ref({
-  customerInfoId: [
+  customerId: [
     {
       required: true,
       message: "请选择客户",
@@ -291,18 +353,24 @@ let rules = ref({
       trigger: "change",
     },
   ],
-
-  contacts: [
+  code: [
     {
       required: true,
-      message: "请输入姓名",
+      message: "请输入订单编号",
       trigger: "blur",
     },
   ],
-  phone: [
+  contactPerson: [
     {
       required: true,
-      message: "请输入联系电话",
+      message: "请输入收货负责人",
+      trigger: "blur",
+    },
+  ],
+  contactNumber: [
+    {
+      required: true,
+      message: "请输入收货电话",
       trigger: "blur",
     },
   ],
@@ -327,6 +395,13 @@ let rules = ref({
       trigger: "blur",
     },
   ],
+  distributionCenter: [
+    {
+      required: true,
+      message: "请输入/选择配送中心",
+      trigger: "blur",
+    },
+  ],
 });
 const { proxy } = getCurrentInstance();
 const selectConfig = reactive([
@@ -335,15 +410,15 @@ const selectConfig = reactive([
     prop: "status",
     data: [
       {
-        label: "进行中",
+        label: "未出库",
         value: "1",
       },
       {
-        label: "已完成",
+        label: "部分出库",
         value: "2",
       },
       {
-        label: "已取消",
+        label: "已出库",
         value: "3",
       },
     ],
@@ -354,18 +429,8 @@ const config = computed(() => {
   return [
     {
       attrs: {
-        label: "订单类型",
-        prop: "type",
-      },
-      render(type) {
-        return proxy.dictDataEcho(type, salesType.value);
-      },
-    },
-    {
-      attrs: {
         label: "订单编号",
         prop: "code",
-        slot: "code",
       },
     },
     {
@@ -376,84 +441,46 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "订单金额",
-        prop: "amountMoney",
-      },
-      render(money) {
-        return proxy.moneyFormat(money, 4);
+        label: "配送中心",
+        prop: "distributionCenter",
       },
     },
     {
       attrs: {
-        label: "收件人",
-        prop: "contacts",
+        label: "详细地址",
+        prop: "address",
+        slot: "address",
       },
     },
     {
       attrs: {
-        label: "联系电话",
-        prop: "phone",
+        label: "收货负责人",
+        prop: "contactPerson",
       },
     },
     {
       attrs: {
-        label: "收件城市",
-        prop: "address",
-        slot: "address",
+        label: "收货电话",
+        prop: "contactNumber",
       },
     },
+
     {
       attrs: {
-        label: "下单时间",
-        prop: "createTime",
+        label: "订单金额",
+        prop: "amount",
+      },
+      render(amount) {
+        return proxy.moneyFormat(amount, 2);
       },
     },
     {
       attrs: {
-        label: "订单状态",
+        label: "出库状态",
         prop: "status",
       },
       render(status) {
-        return status == 1 ? "进行中" : status == 2 ? "已完成" : "已取消";
-      },
-    },
-
-    {
-      attrs: {
-        label: "操作",
-        width: "200",
-        align: "right",
-      },
-      // 渲染 el-button,一般用在最后一列。
-      renderHTML(row) {
-        return [
-          row.status == 1
-            ? {
-                attrs: {
-                  label: "结束",
-                  type: "primary",
-                  text: true,
-                },
-                el: "button",
-                click() {
-                  getDtl(row, 2);
-                },
-              }
-            : {},
-          row.status == 1
-            ? {
-                attrs: {
-                  label: "取消",
-                  type: "primary",
-                  text: true,
-                },
-                el: "button",
-                click() {
-                  getDtl(row, 3);
-                },
-              }
-            : {},
-        ];
+        return status == 1 ? "未出库" : status == 2 ? "部分出库" : "已出库";
       },
     },
   ];
@@ -475,7 +502,7 @@ const treeData = ref([]);
 const formConfig = reactive([
   {
     type: "select",
-    prop: "customerInfoId",
+    prop: "customerId",
     label: "客户名称",
     isLoad: {
       url: "/customer/page",
@@ -492,24 +519,25 @@ const formConfig = reactive([
   },
   {
     type: "input",
-    prop: "contacts",
+    prop: "code",
     label: "订单编号",
     itemWidth: 20,
   },
   {
-    type: "input",
-    prop: "contacts",
+    type: "slot",
+    prop: "distributionCenter",
     label: "配送中心",
+    slotName: "distributionCenter",
   },
   {
     type: "input",
-    prop: "contacts",
+    prop: "contactPerson",
     label: "收货信息",
     itemWidth: 20,
   },
   {
     type: "input",
-    prop: "phone",
+    prop: "contactNumber",
     label: " ",
     itemWidth: 30,
   },
@@ -552,7 +580,7 @@ const openModal = () => {
   dialogVisible.value = true;
   modalType.value = "add";
   formData.data = {
-    orderDetailsList: [],
+    jdOrderDetailsList: [],
     countryId: "China",
   };
   getCityData(formData.data.countryId, "20");
@@ -561,7 +589,7 @@ const openModal = () => {
 const submitForm = () => {
   console.log(byform.value);
   byform.value.handleSubmit((valid) => {
-    const list = formData.data.orderDetailsList;
+    const list = formData.data.jdOrderDetailsList;
     if (!list.length > 0)
       return ElMessage({
         message: `请添加订单明细!`,
@@ -577,7 +605,7 @@ const submitForm = () => {
       }
     }
     submitLoading.value = true;
-    proxy.post("/orderInfo/" + modalType.value, formData.data).then(
+    proxy.post("/jdOrder/" + modalType.value, formData.data).then(
       (res) => {
         ElMessage({
           message: modalType.value == "add" ? "添加成功" : "编辑成功",
@@ -626,10 +654,6 @@ const getDict = () => {
       label: x.dictValue,
       value: x.dictKey,
     }));
-    selectConfig[0].data = salesType.value.map((x) => ({
-      label: x.dictValue,
-      value: x.dictKey,
-    }));
   });
 };
 const countryData = ref([]);
@@ -656,12 +680,12 @@ const getCityData = (id, type, isChange) => {
 };
 getCityData("0");
 getList();
-getDict();
+// getDict();
 
 const totalAmount = () => {
   let sum = 0;
-  for (let i = 0; i < formData.data.orderDetailsList.length; i++) {
-    const e = formData.data.orderDetailsList[i];
+  for (let i = 0; i < formData.data.jdOrderDetailsList.length; i++) {
+    const e = formData.data.jdOrderDetailsList[i];
     e.total = (e.price * 1000000 * e.quantity) / 1000000;
     sum += e.total;
   }
@@ -669,7 +693,7 @@ const totalAmount = () => {
 };
 
 const handleSelect = (row) => {
-  const flag = formData.data.orderDetailsList.some(
+  const flag = formData.data.jdOrderDetailsList.some(
     (x) => x.productId === row.id
   );
   if (flag)
@@ -677,13 +701,14 @@ const handleSelect = (row) => {
       message: "该物品已选择",
       type: "info",
     });
-  formData.data.orderDetailsList.push({
+  formData.data.jdOrderDetailsList.push({
     productName: row.name,
     productCode: row.code,
     productId: row.id,
     total: "",
     quantity: null,
     price: null,
+    remark: "",
   });
   return ElMessage({
     message: "选择成功",
@@ -692,7 +717,7 @@ const handleSelect = (row) => {
 };
 
 const handleRemove = (index) => {
-  formData.data.orderDetailsList.splice(index, 1);
+  formData.data.jdOrderDetailsList.splice(index, 1);
   totalAmount();
   return ElMessage({
     message: "删除成功",
@@ -704,6 +729,83 @@ const handleClickCode = (row) => {
   formData.orderData = row;
   openDetails.value = true;
 };
+let openExcelDialog = ref(false);
+
+const openExcel = () => {
+  importData.customerId = "";
+  openExcelDialog.value = true;
+};
+
+const handleProgress = () => {
+  excelLoading.value = true;
+};
+const handleError = (err) => {
+  console.log(err, "aas");
+  ElMessage({
+    message: `${err},请重试!`,
+    type: "info",
+  });
+  openExcelDialog.value = false;
+  excelLoading.value = false;
+};
+const handleSuccess = (res) => {
+  if (res.code != 200) {
+    return ElMessage({
+      message: `${res.msg},请重试!`,
+      type: "info",
+    });
+  } else {
+    ElMessage({
+      message: "导入成功!",
+      type: "success",
+    });
+    openExcelDialog.value = false;
+    excelLoading.value = false;
+    getList();
+  }
+};
+
+const createFilter = (queryString) => {
+  return (restaurant) => {
+    return (
+      restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
+    );
+  };
+};
+
+const distributionCenterData = ref([]);
+const querySearchPerson = (queryString, callback) => {
+  const results = queryString
+    ? distributionCenterData.value.filter(createFilter(queryString))
+    : distributionCenterData.value;
+  callback(results);
+};
+
+const handlePerson = (item) => {
+  formData.data.buyContactNumber = item.phone;
+};
+const getDistributionCenter = () => {
+  proxy.post("/jdOrder/getDistributionCenter").then(
+    (res) => {
+      distributionCenterData.value = res.map((x) => ({
+        label: x,
+        value: x,
+      }));
+    },
+    (err) => {
+      console.log(err);
+    }
+  );
+  proxy.post("/customer/page", { pageNum: 1, pageSize: 9999 }).then(
+    (res) => {
+      warehouseList.value = res.rows;
+    },
+    (err) => {
+      console.log(err);
+    }
+  );
+};
+getDistributionCenter();
 </script>
   
 <style lang="scss" scoped>

+ 19 - 10
src/views/WDLY/salesMange/jdReGoods/index.vue

@@ -153,14 +153,14 @@
         <el-button @click="openExcelDialog = false" size="large"
           >取 消</el-button
         >
-        <el-button
+        <!-- <el-button
           type="primary"
           @click="submitExcel()"
           size="large"
           :loading="submitLoading"
         >
           确 定
-        </el-button>
+        </el-button> -->
       </template>
     </el-dialog>
   </div>
@@ -631,12 +631,14 @@ const handleRemove = (index) => {
 };
 const openExcel = () => {
   openExcelDialog.value = true;
+  importData.warehouseId = "";
 };
 
 const handleProgress = () => {
   excelLoading.value = true;
 };
 const handleError = (err) => {
+  console.log(res);
   ElMessage({
     message: `${err},请重试!`,
     type: "info",
@@ -644,14 +646,21 @@ const handleError = (err) => {
   openExcelDialog.value = false;
   excelLoading.value = false;
 };
-const handleSuccess = () => {
-  ElMessage({
-    message: "导入成功!",
-    type: "success",
-  });
-  openExcelDialog.value = false;
-  excelLoading.value = false;
-  getList();
+const handleSuccess = (res) => {
+  if (res.code != 200) {
+    return ElMessage({
+      message: `${res.msg},请重试!`,
+      type: "info",
+    });
+  } else {
+    ElMessage({
+      message: "导入成功!",
+      type: "success",
+    });
+    openExcelDialog.value = false;
+    excelLoading.value = false;
+    getList();
+  }
 };
 </script>
   

+ 15 - 8
src/views/WDLY/salesMange/jdSalesData/index.vue

@@ -544,14 +544,21 @@ const handleError = (err) => {
   openExcelDialog.value = false;
   excelLoading.value = false;
 };
-const handleSuccess = () => {
-  ElMessage({
-    message: "导入成功!",
-    type: "success",
-  });
-  openExcelDialog.value = false;
-  excelLoading.value = false;
-  getList();
+const handleSuccess = (res) => {
+  if (res.code != 200) {
+    return ElMessage({
+      message: `${res.msg},请重试!`,
+      type: "info",
+    });
+  } else {
+    ElMessage({
+      message: "导入成功!",
+      type: "success",
+    });
+    openExcelDialog.value = false;
+    excelLoading.value = false;
+    getList();
+  }
 };
 </script>
   

+ 1 - 0
src/views/product/material/index.vue

@@ -539,6 +539,7 @@ const handleClickFile = (file) => {
 const materialUnit = ref([]);
 const getDict = () => {
   proxy.getDict(["material_unit"]).then((res) => {
+    console.log(res, "wsss");
     materialUnit.value = res["material_unit"];
     formConfig.value[4].data = materialUnit.value.map((x) => ({
       label: x.dictValue,