cz vor 2 Jahren
Ursprung
Commit
112ba78226

+ 4 - 2
src/views/WDLY/basic/product/index.vue

@@ -644,7 +644,7 @@ const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
   proxy
-    .post("/productInfo/page", sourceList.value.pagination)
+    .post("/productInfo/pageByWdly", sourceList.value.pagination)
     .then((message) => {
       console.log(message);
       sourceList.value.data = message.rows.map((x) => ({
@@ -746,7 +746,9 @@ const submitForm = () => {
       fileName: x.fileName,
     }));
     submitLoading.value = true;
-    proxy.post("/productInfo/" + modalType.value, formData.data).then(
+    let url =
+      modalType.value == "add" ? "/productInfo/addByWdly" : "/productInfo/edit";
+    proxy.post(url, formData.data).then(
       (res) => {
         ElMessage({
           message: modalType.value == "add" ? "添加成功" : "编辑成功",

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

@@ -439,7 +439,7 @@ const formConfig = computed(() => {
           label: "账期",
           itemWidth: 33,
           controls: false,
-          precision: 0,
+          precision: 2,
           style: {
             width: "100%",
             "margin-right": "10px",
@@ -506,6 +506,8 @@ const getList = async (req) => {
 const openModal = () => {
   dialogVisible.value = true;
   modalType.value = "add";
+  fileList.value = [];
+  fileListCopy.value = [];
   formData.data = {
     type: "1",
     countryId: "China",
@@ -550,7 +552,9 @@ const getDtl = (row) => {
         getCityData(res.countryId, "20");
         getCityData(res.provinceId, "30");
         res.type = res.type + "";
-        res.victoriatouristJson = JSON.parse(res.victoriatouristJson);
+        res.victoriatouristJson = res.victoriatouristJson
+          ? JSON.parse(res.victoriatouristJson)
+          : {};
         formData.data = res;
         dialogVisible.value = true;
       });

+ 713 - 0
src/views/WDLY/salesMange/jdOrder/index.vue

@@ -0,0 +1,713 @@
+<template>
+  <div class="tenant">
+    <!-- <Banner /> -->
+    <div class="content">
+      <byTable
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        highlight-current-row
+        :selectConfig="selectConfig"
+        :table-events="{
+          //element talbe事件都能传
+          select: select,
+        }"
+        :action-list="[
+          {
+            text: '添加订单',
+            action: () => openModal('add'),
+          },
+        ]"
+        @get-list="getList"
+      >
+        <template #code="{ item }">
+          <div
+            style="cursor: pointer; color: #409eff"
+            @click="handleClickCode(item)"
+          >
+            {{ item.code }}
+          </div>
+        </template>
+        <template #address="{ item }">
+          <div>
+            {{ item.countryName }}, {{ item.provinceName }} ,
+            {{ item.cityName }}, {{ item.detailedAddress }}
+          </div>
+        </template>
+      </byTable>
+    </div>
+    <el-dialog
+      :title="modalType == 'add' ? '添加订单' : '调仓接收'"
+      v-model="dialogVisible"
+      width="800"
+      v-loading="loading"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="byform"
+      >
+        <template #address>
+          <el-row style="width: 100%">
+            <el-col :span="8">
+              <el-form-item prop="countryId">
+                <el-select
+                  v-model="formData.data.countryId"
+                  placeholder="国家"
+                  @change="(val) => getCityData(val, '20', true)"
+                >
+                  <el-option
+                    v-for="item in countryData"
+                    :label="item.chineseName"
+                    :value="item.id"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item prop="provinceId">
+                <el-select
+                  v-model="formData.data.provinceId"
+                  placeholder="省/洲"
+                  @change="(val) => getCityData(val, '30', true)"
+                >
+                  <el-option
+                    v-for="item in provinceData"
+                    :label="item.name"
+                    :value="item.id"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item prop="cityId">
+                <el-select v-model="formData.data.cityId" placeholder="城市">
+                  <el-option
+                    v-for="item in cityData"
+                    :label="item.name"
+                    :value="item.id"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row style="margin-top: 20px; width: 100%">
+            <el-col :span="24">
+              <el-form-item prop="detailedAddress">
+                <el-input
+                  v-model="formData.data.detailedAddress"
+                  type="textarea"
+                >
+                </el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </template>
+        <template #products>
+          <div style="width: 100%">
+            <el-button
+              type="primary"
+              @click="openProduct = true"
+              style="margin-bottom: 10px"
+            >
+              添加物品
+            </el-button>
+            <el-table :data="formData.data.orderDetailsList">
+              <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'"
+                    :rules="rules.price"
+                    :inline-message="true"
+                  >
+                    <el-input-number
+                      v-model="row.price"
+                      :precision="4"
+                      :controls="false"
+                      :min="0"
+                      @change="totalAmount"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column prop="quantity" label="数量" min-width="150">
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="'orderDetailsList.' + $index + '.quantity'"
+                    :rules="rules.quantity"
+                    :inline-message="true"
+                  >
+                    <el-input-number
+                      v-model="row.quantity"
+                      :precision="4"
+                      :controls="false"
+                      :min="0"
+                      @change="totalAmount"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column prop="total" label="小计" />
+              <el-table-column prop="remark" label="备注" min-width="200">
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="'orderDetailsList.' + $index + '.remark'"
+                    :rules="rules.remark"
+                    :inline-message="true"
+                  >
+                    <el-input v-model="row.remark" placeholder="请输入" />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="zip"
+                label="操作"
+                width="60"
+                fixed="right"
+                align="center"
+              >
+                <template #default="{ $index }">
+                  <el-button type="primary" link @click="handleRemove($index)"
+                    >删除</el-button
+                  >
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="submitForm('byform')"
+          size="large"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
+    <el-dialog
+      v-model="openProduct"
+      title="选择产品"
+      width="70%"
+      append-to-body
+    >
+      <SelectProduct @handleSelect="handleSelect"></SelectProduct>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="openProduct = false">取消</el-button>
+        </span>
+      </template>
+    </el-dialog>
+
+    <el-dialog
+      v-model="openDetails"
+      title="订单详情"
+      width="40%"
+      append-to-body
+    >
+      <OrderDetails
+        :orderData="formData.orderData"
+        :key="formData.orderData.id"
+      ></OrderDetails>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="openDetails = false">取消</el-button>
+        </span>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+  
+<script setup>
+/* eslint-disable vue/no-unused-components */
+import { ElMessage, ElMessageBox } from "element-plus";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+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";
+
+const loading = ref(false);
+const submitLoading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+  },
+});
+let dialogVisible = ref(false);
+let openProduct = ref(false);
+let openDetails = ref(false);
+
+let roomDialogVisible = ref(false);
+let modalType = ref("add");
+let rules = ref({
+  customerInfoId: [
+    {
+      required: true,
+      message: "请选择客户",
+      trigger: "change",
+    },
+  ],
+  type: [
+    {
+      required: true,
+      message: "请选择订单类型",
+      trigger: "change",
+    },
+  ],
+  countryId: [
+    {
+      required: true,
+      message: "请选择国家",
+      trigger: "change",
+    },
+  ],
+  provinceId: [
+    {
+      required: true,
+      message: "请选择省/洲",
+      trigger: "change",
+    },
+  ],
+  cityId: [
+    {
+      required: true,
+      message: "请选择城市",
+      trigger: "change",
+    },
+  ],
+
+  contacts: [
+    {
+      required: true,
+      message: "请输入姓名",
+      trigger: "blur",
+    },
+  ],
+  phone: [
+    {
+      required: true,
+      message: "请输入联系电话",
+      trigger: "blur",
+    },
+  ],
+  detailedAddress: [
+    {
+      required: true,
+      message: "请输入详细地址",
+      trigger: "blur",
+    },
+  ],
+  price: [
+    {
+      required: true,
+      message: "请输入单价",
+      trigger: "blur",
+    },
+  ],
+  quantity: [
+    {
+      required: true,
+      message: "请输入数量",
+      trigger: "blur",
+    },
+  ],
+});
+const { proxy } = getCurrentInstance();
+const selectConfig = reactive([
+  {
+    label: "入库状态",
+    prop: "status",
+    data: [
+      {
+        label: "进行中",
+        value: "1",
+      },
+      {
+        label: "已完成",
+        value: "2",
+      },
+      {
+        label: "已取消",
+        value: "3",
+      },
+    ],
+  },
+]);
+
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "订单类型",
+        prop: "type",
+      },
+      render(type) {
+        return proxy.dictDataEcho(type, salesType.value);
+      },
+    },
+    {
+      attrs: {
+        label: "订单编号",
+        prop: "code",
+        slot: "code",
+      },
+    },
+    {
+      attrs: {
+        label: "客户名称",
+        prop: "customerName",
+      },
+    },
+    {
+      attrs: {
+        label: "订单金额",
+        prop: "amountMoney",
+      },
+      render(money) {
+        return proxy.moneyFormat(money, 4);
+      },
+    },
+    {
+      attrs: {
+        label: "收件人",
+        prop: "contacts",
+      },
+    },
+    {
+      attrs: {
+        label: "联系电话",
+        prop: "phone",
+      },
+    },
+    {
+      attrs: {
+        label: "收件城市",
+        prop: "address",
+        slot: "address",
+      },
+    },
+    {
+      attrs: {
+        label: "下单时间",
+        prop: "createTime",
+      },
+    },
+    {
+      attrs: {
+        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);
+                },
+              }
+            : {},
+        ];
+      },
+    },
+  ];
+});
+
+let formData = reactive({
+  data: {},
+  treeData: [],
+  orderData: {},
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const treeData = ref([]);
+const formConfig = reactive([
+  {
+    type: "select",
+    prop: "customerInfoId",
+    label: "客户名称",
+    isLoad: {
+      url: "/customer/page",
+      req: {
+        pageNum: 1,
+        pageSize: 9999,
+      },
+      labelKey: "name",
+      labelVal: "id",
+      method: "post",
+      resUrl: "rows",
+    },
+    itemWidth: 30,
+  },
+  {
+    type: "input",
+    prop: "contacts",
+    label: "订单编号",
+    itemWidth: 20,
+  },
+  {
+    type: "input",
+    prop: "contacts",
+    label: "配送中心",
+  },
+  {
+    type: "input",
+    prop: "contacts",
+    label: "收货信息",
+    itemWidth: 20,
+  },
+  {
+    type: "input",
+    prop: "phone",
+    label: " ",
+    itemWidth: 30,
+  },
+  {
+    type: "slot",
+    slotName: "address",
+    prop: "countryId",
+    label: "详细地址",
+    required: true,
+  },
+  {
+    type: "title",
+    title: "订单明细",
+  },
+  {
+    type: "slot",
+    slotName: "products",
+  },
+  {
+    type: "input",
+    prop: "amountMoney",
+    label: "订单金额",
+    disabled: true,
+    itemWidth: 20,
+  },
+]);
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/jdOrder/page", sourceList.value.pagination).then((message) => {
+    console.log(message);
+    sourceList.value.data = message.rows;
+    sourceList.value.pagination.total = message.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+const openModal = () => {
+  dialogVisible.value = true;
+  modalType.value = "add";
+  formData.data = {
+    orderDetailsList: [],
+    countryId: "China",
+  };
+  getCityData(formData.data.countryId, "20");
+};
+
+const submitForm = () => {
+  console.log(byform.value);
+  byform.value.handleSubmit((valid) => {
+    const list = formData.data.orderDetailsList;
+    if (!list.length > 0)
+      return ElMessage({
+        message: `请添加订单明细!`,
+        type: "info",
+      });
+    for (let i = 0; i < list.length; i++) {
+      const e = list[i];
+      if (e.quantity == 0) {
+        return ElMessage({
+          message: `数量不能为0!`,
+          type: "info",
+        });
+      }
+    }
+    submitLoading.value = true;
+    proxy.post("/orderInfo/" + modalType.value, formData.data).then(
+      (res) => {
+        ElMessage({
+          message: modalType.value == "add" ? "添加成功" : "编辑成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      (err) => (submitLoading.value = false)
+    );
+  });
+};
+
+const getDtl = (row, status) => {
+  const statusNmae = status == 2 ? "结束" : "取消";
+  // 弹窗提示是否删除
+  ElMessageBox.confirm(`您确定执行${statusNmae}操作吗?`, "提示", {
+    confirmButtonText: "确定",
+    cancelButtonText: "取消",
+    type: "warning",
+  }).then(() => {
+    // 删除
+    proxy
+      .post("/orderInfo/edit", {
+        id: row.id,
+        status,
+      })
+      .then((res) => {
+        ElMessage({
+          message: "操作成功",
+          type: "success",
+        });
+        getList();
+      });
+  });
+};
+
+const warehouseList = ref([]);
+const salesType = ref([]);
+
+const getDict = () => {
+  proxy.getDict(["order_sales_type"]).then((res) => {
+    salesType.value = res["order_sales_type"];
+    formConfig[1].data = salesType.value.map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+    selectConfig[0].data = salesType.value.map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
+};
+const countryData = ref([]);
+const provinceData = ref([]);
+const cityData = ref([]);
+
+const getCityData = (id, type, isChange) => {
+  proxy.post("/areaInfo/list", { parentId: id }).then((res) => {
+    if (type === "20") {
+      provinceData.value = res;
+      if (isChange) {
+        formData.data.provinceId = "";
+        formData.data.cityId = "";
+      }
+    } else if (type === "30") {
+      cityData.value = res;
+      if (isChange) {
+        formData.data.cityId = "";
+      }
+    } else {
+      countryData.value = res;
+    }
+  });
+};
+getCityData("0");
+getList();
+getDict();
+
+const totalAmount = () => {
+  let sum = 0;
+  for (let i = 0; i < formData.data.orderDetailsList.length; i++) {
+    const e = formData.data.orderDetailsList[i];
+    e.total = (e.price * 1000000 * e.quantity) / 1000000;
+    sum += e.total;
+  }
+  formData.data.amountMoney = sum;
+};
+
+const handleSelect = (row) => {
+  const flag = formData.data.orderDetailsList.some(
+    (x) => x.productId === row.id
+  );
+  if (flag)
+    return ElMessage({
+      message: "该物品已选择",
+      type: "info",
+    });
+  formData.data.orderDetailsList.push({
+    productName: row.name,
+    productCode: row.code,
+    productId: row.id,
+    total: "",
+    quantity: null,
+    price: null,
+  });
+  return ElMessage({
+    message: "选择成功",
+    type: "success",
+  });
+};
+
+const handleRemove = (index) => {
+  formData.data.orderDetailsList.splice(index, 1);
+  totalAmount();
+  return ElMessage({
+    message: "删除成功",
+    type: "success",
+  });
+};
+
+const handleClickCode = (row) => {
+  formData.orderData = row;
+  openDetails.value = true;
+};
+</script>
+  
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+</style>

+ 562 - 0
src/views/WDLY/salesMange/jdSalesData/index.vue

@@ -0,0 +1,562 @@
+<template>
+  <div class="tenant">
+    <!-- <Banner /> -->
+    <div class="content">
+      <byTable
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        highlight-current-row
+        :selectConfig="selectConfig"
+        :table-events="{
+          //element talbe事件都能传
+        }"
+        :action-list="[
+          {
+            text: 'Excel导入',
+            action: () => openExcel(),
+            disabled: false,
+          },
+        ]"
+        @get-list="getList"
+      >
+        <template #fileSlot="{ item }">
+          <div
+            style="cursor: pointer; color: #409eff"
+            @click="handleClickFile(item)"
+          >
+            {{ item.fileName }}
+          </div>
+        </template>
+      </byTable>
+    </div>
+    <el-dialog
+      :title="modalType === 'add' ? '添加退货' : '到货通知'"
+      v-model="dialogVisible"
+      width="800"
+      v-loading="loading"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="byform"
+      >
+        <template #detailSlot>
+          <div style="width: 100%">
+            <el-button
+              type="primary"
+              @click="openProduct = true"
+              style="margin-bottom: 10px"
+              v-if="modalType != 'detail'"
+            >
+              添加物品
+            </el-button>
+            <el-table :data="formData.data.jdBackDetailsList">
+              <el-table-column prop="productCode" label="货品编码" />
+              <el-table-column prop="productName" label="货品名称" />
+              <el-table-column prop="quantity" label="退货数量" min-width="150">
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="'jdBackDetailsList.' + $index + '.quantity'"
+                    :rules="rules.quantity"
+                    :inline-message="true"
+                  >
+                    <el-input-number
+                      v-model="row.quantity"
+                      :precision="4"
+                      :controls="false"
+                      :min="0"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="zip"
+                label="操作"
+                width="100"
+                v-if="modalType != 'detail'"
+              >
+                <template #default="{ $index }">
+                  <el-button type="primary" link @click="handleRemove($index)"
+                    >删除</el-button
+                  >
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </template>
+      </byForm>
+
+      <template #footer v-if="modalType != 'detail'">
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="submitForm()"
+          size="large"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
+    <el-dialog
+      v-model="openProduct"
+      title="选择产品"
+      width="70%"
+      append-to-body
+    >
+      <SelectProduct @handleSelect="handleSelect"></SelectProduct>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="openProduct = false">取消</el-button>
+        </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.warehouseId" 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.warehouseId">
+        <el-upload
+          action="/dev-api/salesRecord/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" size="large"
+          >取 消</el-button
+        >
+        <el-button
+          type="primary"
+          @click="submitExcel()"
+          size="large"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+  
+<script setup>
+import { ElMessage, ElMessageBox } from "element-plus";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import { watch } from "vue";
+import SelectProduct from "@/components/WDLY/product/SelectProduct";
+import { getToken } from "@/utils/auth";
+
+const uploadData = ref({});
+const headers = ref({ Authorization: "Bearer " + getToken() });
+const loading = ref(false);
+const submitLoading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+  },
+});
+let dialogVisible = ref(false);
+let openProduct = ref(false);
+let openExcelDialog = ref(false);
+let excelLoading = ref(false);
+
+let modalType = ref("add");
+let rules = ref({
+  warehouseId: [{ required: true, message: "请选择仓库", trigger: "change" }],
+  logisticsCompanyCode: [
+    { required: true, message: "请选择物流公司", trigger: "change" },
+  ],
+  logisticsCode: [
+    { required: true, message: "请输入物流/快递单号", trigger: "blur" },
+  ],
+  quantity: [{ required: true, message: "请输入退货数量", trigger: "blur" }],
+});
+const { proxy } = getCurrentInstance();
+const selectConfig = reactive([]);
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "销售日期",
+        prop: "dateSale",
+      },
+    },
+
+    {
+      attrs: {
+        label: "产品分类",
+        prop: "warehouseName",
+      },
+    },
+    {
+      attrs: {
+        label: "产品编码",
+        prop: "warehouseName",
+      },
+    },
+    {
+      attrs: {
+        label: "产品名称",
+        prop: "logisticsCompanyName",
+      },
+    },
+    {
+      attrs: {
+        label: "规格型号",
+        prop: "logisticsCode",
+      },
+    },
+    {
+      attrs: {
+        label: "单位",
+        prop: "createTime",
+      },
+    },
+    {
+      attrs: {
+        label: "销售数量",
+        prop: "quantity",
+      },
+    },
+    {
+      attrs: {
+        label: "导入时间",
+        prop: "createTime",
+      },
+    },
+  ];
+});
+
+let formData = reactive({
+  data: {},
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+});
+const byform = ref(null);
+let formConfig = reactive([
+  {
+    type: "title",
+    title: "退货信息",
+  },
+  {
+    type: "select",
+    prop: "warehouseId",
+    label: "仓库名称",
+    itemWidth: 100,
+    disabled: false,
+    data: [],
+  },
+  {
+    type: "select",
+    label: "物流信息",
+    prop: "logisticsCompanyCode",
+    itemWidth: 50,
+    style: {
+      width: "100%",
+    },
+  },
+  {
+    type: "input",
+    label: " ",
+    prop: "logisticsCode",
+    itemWidth: 50,
+  },
+  {
+    type: "slot",
+    slotName: "detailSlot",
+    label: "发货明细",
+  },
+]);
+const configData = [
+  [
+    {
+      type: "input",
+      prop: "supplyName",
+      label: "供应商",
+      disabled: true,
+      itemWidth: 50,
+    },
+    {
+      type: "input",
+      prop: "purchaseCode",
+      label: "采购单号",
+      disabled: true,
+      itemWidth: 50,
+    },
+    {
+      type: "select",
+      label: "物流信息",
+      prop: "logisticsCompanyCode",
+      itemWidth: 50,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "input",
+      label: " ",
+      prop: "code",
+      itemWidth: 50,
+    },
+    {
+      type: "slot",
+      slotName: "detailSlot",
+      label: "发货明细",
+    },
+  ],
+  [
+    {
+      type: "input",
+      prop: "supplyName",
+      label: "供应商",
+      disabled: true,
+      itemWidth: 50,
+    },
+    {
+      type: "input",
+      prop: "purchaseCode",
+      label: "采购单号",
+      disabled: true,
+      itemWidth: 50,
+    },
+    {
+      type: "select",
+      label: "物流/快递单号",
+      prop: "deliverGoodsId",
+      itemWidth: 50,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "slot",
+      slotName: "detailSlot",
+      label: "发货明细",
+    },
+  ],
+];
+
+const deliverData = ref([]);
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/salesRecord/page", sourceList.value.pagination)
+    .then((message) => {
+      console.log(message);
+      sourceList.value.data = message.rows;
+      sourceList.value.pagination.total = message.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
+};
+
+const submitForm = () => {
+  byform.value.handleSubmit((valid) => {
+    const list = formData.data.jdBackDetailsList;
+    if (!list.length > 0) {
+      return ElMessage({
+        message: `请添加退货明细`,
+        type: "info",
+      });
+    }
+    for (let i = 0; i < list.length; i++) {
+      const e = list[i];
+      if (e.quantity == 0) {
+        return ElMessage({
+          message: `退货数量不能为0!`,
+          type: "info",
+        });
+      }
+    }
+    loading.value = true;
+    submitLoading.value = true;
+    proxy.post("/jdBack/" + modalType.value, formData.data).then(
+      (res) => {
+        ElMessage({
+          message: `操作成功!`,
+          type: "success",
+        });
+        dialogVisible.value = false;
+        submitLoading.value = false;
+        loading.value = false;
+        getList();
+      },
+      (err) => (submitLoading.value = false)
+    );
+  });
+};
+
+const getDtl = (row, type) => {
+  modalType.value = type;
+  proxy.post("/jdBack/detail", { id: row.id }).then((res) => {
+    formData.data = res;
+    dialogVisible.value = true;
+  });
+};
+
+const importData = reactive({});
+
+const handleEdit = (row, status) => {
+  let purchaseStatusName = status == 88 ? "作废" : "终止";
+  const data = { ...row, purchaseStatus: status };
+  // 弹窗提示是否删除
+  ElMessageBox.confirm(
+    `此操作将${purchaseStatusName}该数据, 是否继续?`,
+    "提示",
+    {
+      confirmButtonText: "确定",
+      cancelButtonText: "取消",
+      type: "warning",
+    }
+  ).then(() => {
+    // 删除
+    proxy.post("/purchase/edit", data).then((res) => {
+      ElMessage({
+        message: `${purchaseStatusName}成功`,
+        type: "success",
+      });
+      getList();
+    });
+  });
+};
+
+const logisticsData = ref([]);
+const getLogisticsData = (row) => {
+  proxy.post("/companyInfo/list", { pageNum: 1, pageSize: 999 }).then((res) => {
+    logisticsData.value = res.reverse().slice(0, 100); //截取前100
+    formConfig[2].data = logisticsData.value.map((x) => ({
+      label: x.name,
+      value: x.code,
+    }));
+  });
+};
+
+watch(modalType, (val) => {
+  if (val) {
+    formConfig[1].disabled = val == "detail" ? true : false;
+    formConfig[2].disabled = val == "detail" ? true : false;
+    formConfig[3].disabled = val == "detail" ? true : false;
+  }
+});
+const openModal = () => {
+  dialogVisible.value = true;
+  modalType.value = "add";
+  formData.data = {
+    type: "1",
+    status: "1",
+    jdBackDetailsList: [],
+  };
+};
+
+const warehouseList = ref([]);
+const warehouseListData = () => {
+  // // 币种数据
+  proxy
+    .post("/warehouse/page", {
+      pageNum: 1,
+      pageSize: 10,
+    })
+    .then((message) => {
+      warehouseList.value = message.rows;
+      formConfig[1].data = message.rows.map((x) => ({
+        label: x.name,
+        value: x.id,
+      }));
+    });
+};
+
+getList();
+getLogisticsData();
+warehouseListData();
+
+const handleSelect = (row) => {
+  const flag = formData.data.jdBackDetailsList.some(
+    (x) => x.productId === row.id
+  );
+  if (flag)
+    return ElMessage({
+      message: "该物品已选择",
+      type: "info",
+    });
+  formData.data.jdBackDetailsList.push({
+    quantity: null,
+    productName: row.name,
+    productCode: row.code,
+    productId: row.id,
+  });
+  return ElMessage({
+    message: "选择成功",
+    type: "success",
+  });
+};
+
+const handleRemove = (index) => {
+  formData.data.jdBackDetailsList.splice(index, 1);
+  return ElMessage({
+    message: "删除成功",
+    type: "success",
+  });
+};
+const openExcel = () => {
+  openExcelDialog.value = true;
+};
+
+const handleProgress = () => {
+  excelLoading.value = true;
+};
+const handleError = (err) => {
+  ElMessage({
+    message: `${err},请重试!`,
+    type: "info",
+  });
+  openExcelDialog.value = false;
+  excelLoading.value = false;
+};
+const handleSuccess = () => {
+  ElMessage({
+    message: "导入成功!",
+    type: "success",
+  });
+  openExcelDialog.value = false;
+  excelLoading.value = false;
+  getList();
+};
+</script>
+  
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+</style>

+ 506 - 0
src/views/WDLY/stockManage/receiptData/index.vue

@@ -0,0 +1,506 @@
+<template>
+  <div class="tenant">
+    <!-- <Banner /> -->
+
+    <div style="background: #fff">
+      <el-tabs
+        v-model="activeName"
+        type="card"
+        class="demo-tabs"
+        @tab-change="handleChange"
+      >
+        <el-tab-pane label="入库单" name="first"></el-tab-pane>
+        <el-tab-pane label="出库单" name="second"></el-tab-pane>
+        <el-tab-pane label="调仓单" name="three"></el-tab-pane>
+        <el-tab-pane label="盘点单" name="four"></el-tab-pane>
+      </el-tabs>
+      <byTable
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        highlight-current-row
+        :selectConfig="[]"
+        :table-events="{
+          //element talbe事件都能传
+          select: select,
+        }"
+        :action-list="[]"
+        @get-list="getList"
+      >
+      </byTable>
+    </div>
+    <el-dialog
+      :title="modalType == 'add' ? '良品转次品' : '次品转良品'"
+      v-model="dialogVisible"
+      width="800"
+      v-loading="loading"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="byform"
+      >
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="submitForm('byform')"
+          size="large"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+  
+<script setup>
+/* eslint-disable vue/no-unused-components */
+import { ElMessage, ElMessageBox } from "element-plus";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import { computed, defineComponent, ref, watch } from "vue";
+import useUserStore from "@/store/modules/user";
+import SelectProduct from "@/components/product/SelectProduct";
+
+const loading = ref(false);
+let activeName = ref("first");
+const submitLoading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+  },
+});
+let dialogVisible = ref(false);
+let openProduct = ref(false);
+
+let roomDialogVisible = ref(false);
+let modalType = ref("add");
+let rules = ref({
+  qualified: [{ required: true, message: "请输入数量", trigger: "blur" }],
+});
+const { proxy } = getCurrentInstance();
+const selectConfig = reactive([
+  // {
+  //   label: "spu类型",
+  //   prop: "type",
+  //   data: [],
+  // },
+]);
+const requestUrl = ref("");
+let config = reactive([]);
+const configData = [
+  [
+    {
+      attrs: {
+        label: "入库单号",
+        prop: "code",
+      },
+    },
+    {
+      attrs: {
+        label: "入库类型",
+        prop: "type",
+      },
+    },
+    {
+      attrs: {
+        label: "仓库名称",
+        prop: "warehouseName",
+      },
+    },
+    {
+      attrs: {
+        label: "操作人",
+        prop: "userName",
+      },
+    },
+    {
+      attrs: {
+        label: "操作时间",
+        prop: "createTime",
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "100",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "查看",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row, "add");
+            },
+          },
+        ];
+      },
+    },
+  ],
+  [
+    {
+      attrs: {
+        label: "出库单号",
+        prop: "code",
+      },
+    },
+    {
+      attrs: {
+        label: "出库类型",
+        prop: "type",
+      },
+    },
+    {
+      attrs: {
+        label: "仓库名称",
+        prop: "warehouseName",
+      },
+    },
+    {
+      attrs: {
+        label: "操作人",
+        prop: "userName",
+      },
+    },
+    {
+      attrs: {
+        label: "操作时间",
+        prop: "createTime",
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "100",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "查看",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row, "add");
+            },
+          },
+        ];
+      },
+    },
+  ],
+  [
+    {
+      attrs: {
+        label: "调仓单号",
+        prop: "code",
+      },
+    },
+    {
+      attrs: {
+        label: "调仓类型",
+        prop: "type",
+      },
+    },
+    {
+      attrs: {
+        label: "调出仓库",
+        prop: "outWarehouseName",
+      },
+    },
+    {
+      attrs: {
+        label: "操作人",
+        prop: "outUserName",
+      },
+    },
+    {
+      attrs: {
+        label: "操作时间",
+        prop: "createTime",
+      },
+    },
+    {
+      attrs: {
+        label: "调入仓库",
+        prop: "inWarehouseName",
+      },
+    },
+    {
+      attrs: {
+        label: "接收人",
+        prop: "inUserName",
+      },
+    },
+    {
+      attrs: {
+        label: "接收时间",
+        prop: "inTime",
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "100",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "查看",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row, "add");
+            },
+          },
+        ];
+      },
+    },
+  ],
+  [
+    {
+      attrs: {
+        label: "盘点单号",
+        prop: "code",
+      },
+    },
+    {
+      attrs: {
+        label: "仓库名称",
+        prop: "warehouseName",
+      },
+    },
+    {
+      attrs: {
+        label: "盘点时间",
+        prop: "createTime",
+      },
+    },
+    {
+      attrs: {
+        label: "盘点人",
+        prop: "userName",
+      },
+    },
+    {
+      attrs: {
+        label: "盘点结论",
+        prop: "result",
+      },
+      render(result) {
+        return result == 0 ? "正常" : "异常";
+      },
+    },
+    {
+      attrs: {
+        label: "盘点物品数",
+        prop: "totalNum",
+      },
+    },
+    {
+      attrs: {
+        label: "正常物品数",
+        prop: "normalNum",
+      },
+    },
+    {
+      attrs: {
+        label: "异常物品数",
+        prop: "anomalyNum",
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "100",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "查看",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row, "add");
+            },
+          },
+        ];
+      },
+    },
+  ],
+];
+
+let formData = reactive({
+  data: {},
+  treeData: [],
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+
+const formConfig = reactive([
+  {
+    type: "input",
+    prop: "canSum",
+    label: "可转数量",
+    disabled: true,
+  },
+  {
+    type: "input",
+    prop: "qualified",
+    label: "数量",
+  },
+]);
+const byform = ref(null);
+
+const getList = async (req) => {
+  loading.value = true;
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  proxy.post(requestUrl.value, sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+
+const submitForm = () => {
+  let submitAddress =
+    modalType.value === "add"
+      ? "/stock/defectiveToQualified"
+      : "/stock/qualifiedToDefective";
+  byform.value.handleSubmit((valid) => {
+    if (Number(formData.data.qualified) > Number(formData.data.canSum)) {
+      return ElMessage({
+        message: "不可大于可转数量!",
+        type: "info",
+      });
+    }
+    submitLoading.value = true;
+    proxy.post(submitAddress, formData.data).then(
+      (res) => {
+        ElMessage({
+          message: "操作成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      (err) => (submitLoading.value = false)
+    );
+  });
+};
+
+const getDtl = (row, type) => {
+  // modalType.value = type;
+  // let canSum = type === "add" ? row.quantity : row.defectiveQuantity;
+  // formData.data = {
+  //   id: row.id,
+  //   canSum,
+  //   qualified: "",
+  // };
+  // dialogVisible.value = true;
+};
+
+const handleChange = (val) => {
+  if (!val) return;
+  switch (val) {
+    case "first": {
+      requestUrl.value = "/stockJournal/page";
+      sourceList.value.pagination = {
+        pageNum: 1,
+        pageSize: 10,
+        total: 0,
+        type: "1,4",
+      };
+      config = configData[0];
+      break;
+    }
+
+    case "second": {
+      requestUrl.value = "/stockJournal/page";
+      sourceList.value.pagination = {
+        pageNum: 1,
+        pageSize: 10,
+        total: 0,
+        type: "2,5",
+      };
+      config = configData[1];
+      break;
+    }
+    case "three": {
+      requestUrl.value = "/stockTransfer/page";
+      sourceList.value.pagination = {
+        pageNum: 1,
+        pageSize: 10,
+        total: 0,
+      };
+      config = configData[2];
+      break;
+    }
+    case "four": {
+      requestUrl.value = "/stockCheck/page";
+      sourceList.value.pagination = {
+        pageNum: 1,
+        pageSize: 10,
+        total: 0,
+      };
+      config = configData[3];
+      break;
+    }
+  }
+  getList();
+};
+
+onMounted(() => {
+  config = configData[0];
+  requestUrl.value = "/stockJournal/page";
+  sourceList.value.pagination = {
+    pageNum: 1,
+    pageSize: 10,
+    total: 0,
+    type: "1,4",
+  };
+  getList();
+});
+</script>
+  
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+</style>

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

@@ -213,6 +213,9 @@ const config = computed(() => {
         label: "单位",
         prop: "unit",
       },
+      render(unit) {
+        proxy.dictDataEcho(unit, materialUnit.value);
+      },
     },
     {
       attrs: {
@@ -532,6 +535,18 @@ const handleRemove = (file) => {
 const handleClickFile = (file) => {
   window.open(file.fileUrl, "_blank");
 };
+
+const materialUnit = ref([]);
+const getDict = () => {
+  proxy.getDict(["material_unit"]).then((res) => {
+    materialUnit.value = res["material_unit"];
+    formConfig.value[4].data = materialUnit.value.map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
+};
+getDict();
 </script>
   
 <style lang="scss" scoped>

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

@@ -74,7 +74,6 @@
               :before-upload="handleBeforeUpload"
               accept=".gif, .jpeg, .jpg, .png"
             >
-              >
               <el-icon><Plus /></el-icon>
             </el-upload>
           </div>

+ 0 - 1
src/views/product/product/index2.vue

@@ -74,7 +74,6 @@
               :before-upload="handleBeforeUpload"
               accept=".gif, .jpeg, .jpg, .png"
             >
-              >
               <el-icon><Plus /></el-icon>
             </el-upload>
           </div>

+ 3 - 1
src/views/purchaseManage/supplier/supplier/index.vue

@@ -422,6 +422,8 @@ const getList = async (req) => {
 const openModal = () => {
   dialogVisible.value = true;
   modalType.value = "add";
+  fileList.value = [];
+  fileListCopy.value = [];
   formData.data = {
     type: "1",
     countryId: "China",
@@ -461,7 +463,7 @@ const getDtl = (row) => {
     proxy
       .post("/fileInfo/getList", { businessIdList: [row.id] })
       .then((fileObj) => {
-        fileList.value = fileObj[row.id];
+        fileList.value = fileObj[row.id] || [];
         fileListCopy.value = [...fileList.value];
         getCityData(res.countryId, "20");
         getCityData(res.provinceId, "30");

+ 7 - 4
src/views/purchaseSales/stockManage/inventory/index.vue

@@ -26,7 +26,7 @@
             style="cursor: pointer; color: #409eff"
             @click="handleClickCode(item)"
           >
-            {{ item.code }}aa
+            {{ item.code }}
           </div>
         </template>
       </byTable>
@@ -160,16 +160,16 @@ const { proxy } = getCurrentInstance();
 const selectConfig = reactive([
   {
     label: "盘点结论",
-    prop: "type",
+    prop: "result",
     data: [
       {
         label: "正常",
-        value: "1",
+        value: "0",
       },
 
       {
         label: "异常",
-        value: "2",
+        value: "1",
       },
     ],
   },
@@ -207,6 +207,9 @@ const config = computed(() => {
         label: "盘点结论",
         prop: "result",
       },
+      render(result) {
+        return result == 0 ? "正常" : "异常";
+      },
     },
     {
       attrs: {