Browse Source

维多利亚定制 部分静态页面

cz 2 years ago
parent
commit
e643bde737

+ 833 - 0
src/components/WDLY/product/SelectProduct.vue

@@ -0,0 +1,833 @@
+<template>
+  <div class="user">
+    <!-- <div class="tree">
+      <treeList
+        title="产品分类"
+        submitType="1"
+        :data="treeListData"
+        v-model="sourceList.pagination.productClassifyId"
+        @change="treeChange"
+        @changeTreeList="getTreeList"
+      >
+      </treeList>
+    </div> -->
+    <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="[]"
+        @get-list="getList"
+      >
+        <template #pic="{ item }">
+          <div v-if="item.fileList.length > 0">
+            <img
+              :src="item.fileList[0].fileUrl"
+              class="pic"
+              @click="handleClickFile(item.fileList[0])"
+            />
+          </div>
+          <div v-else></div>
+        </template>
+      </byTable>
+    </div>
+    <el-dialog
+      :title="modalType == 'add' ? '添加' : '编辑'"
+      v-model="dialogVisible"
+      width="500"
+      v-loading="loading"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="byform"
+      >
+        <template #productPic>
+          <div>
+            <el-upload
+              v-model:fileList="fileList"
+              action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
+              :data="uploadData"
+              list-type="picture-card"
+              :on-remove="handleRemove"
+              :on-success="handleSuccess"
+              :before-upload="handleBeforeUpload"
+            >
+              <el-icon><Plus /></el-icon>
+            </el-upload>
+          </div>
+        </template>
+
+        <template #combination>
+          <el-form
+            ref="tableForm"
+            :model="formData.data"
+            :rules="rules"
+            style="margin-top: 15px"
+          >
+            <el-form-item
+              label="组合明细"
+              v-show="formData.data.combination == 1"
+            >
+              <el-button
+                type="primary"
+                @click="openProduct = true"
+                style="margin-bottom: 10px"
+              >
+                添加
+              </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>
+          </el-form>
+        </template>
+        <template #one>
+          <div style="width: 100%">
+            <el-row>
+              <el-col :span="4">
+                <el-input
+                  v-model="formData.data.victoriatouristJson.newProductsDay1"
+                  placeholder="请输入"
+                  disabled
+                />
+              </el-col>
+              <el-col :span="1" style="text-align: center"> ~ </el-col>
+              <el-col :span="4">
+                <el-input
+                  v-model="formData.data.victoriatouristJson.newProductsDay"
+                  placeholder="请输入"
+                  @change="changeDay(10)"
+                >
+                </el-input>
+              </el-col>
+              <el-col :span="1" style="text-align: center"> : </el-col>
+              <el-col :span="6">
+                <el-input
+                  v-model="
+                    formData.data.victoriatouristJson.newProductsExpectedSales
+                  "
+                  placeholder="预期销量"
+                />
+              </el-col>
+            </el-row>
+          </div>
+        </template>
+        <template #two>
+          <div style="width: 100%">
+            <el-row>
+              <el-col :span="4">
+                <el-input
+                  v-model="formData.data.victoriatouristJson.growUpDay1"
+                  placeholder="请输入"
+                  disabled
+                />
+              </el-col>
+              <el-col :span="1" style="text-align: center"> ~ </el-col>
+              <el-col :span="4">
+                <el-input
+                  v-model="formData.data.victoriatouristJson.growUpDay"
+                  placeholder="请输入"
+                  @change="changeDay(20)"
+                >
+                </el-input>
+              </el-col>
+              <el-col :span="1" style="text-align: center"> : </el-col>
+              <el-col :span="6">
+                <el-input
+                  v-model="
+                    formData.data.victoriatouristJson.growUpExpectedSales
+                  "
+                  placeholder="预期销量"
+                />
+              </el-col>
+            </el-row>
+          </div>
+        </template>
+        <template #three>
+          <el-row style="width: 100%">
+            <el-col :span="5">
+              大于{{ formData.data.victoriatouristJson.attDay }}天:
+            </el-col>
+            <el-col :span="6">
+              <el-input
+                v-model="formData.data.victoriatouristJson.matureExpectedSales"
+                placeholder="预期销量"
+              />
+            </el-col>
+          </el-row>
+        </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
+      title="Excel导入"
+      v-model="openExcelDialog"
+      width="400"
+      v-loading="loading"
+    >
+      <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>
+    <el-dialog
+      v-model="openProduct"
+      title="选择货品"
+      width="70%"
+      append-to-body
+    >
+      <SelectGoods
+        @cancel="openProduct = false"
+        @pushGoods="pushGoods"
+      ></SelectGoods>
+    </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 treeList from "@/components/product/treeList";
+import SelectGoods from "@/components/product/SelectGoods";
+
+import { computed, defineComponent, ref } from "vue";
+let openProduct = ref(false);
+
+const loading = ref(false);
+const submitLoading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+    type: "",
+    productClassifyId: "",
+    keyword: "",
+    definition: "1",
+  },
+});
+let dialogVisible = ref(false);
+let openExcelDialog = ref(false);
+
+let modalType = ref("add");
+let rules = ref({
+  productClassifyId: [
+    { required: true, message: "请选择产品分类", trigger: "change" },
+  ],
+  type: [{ required: true, message: "请选择产品类型", trigger: "change" }],
+  name: [{ required: true, message: "请输入产品名称", trigger: "blur" }],
+  unit: [{ required: true, message: "请选择单位", trigger: "change" }],
+  linkQuantity: [
+    { required: true, message: "请输入组合数量", trigger: "blur" },
+  ],
+});
+const { proxy } = getCurrentInstance();
+const selectConfig = computed(() => {
+  return [
+    {
+      label: "产品类型",
+      prop: "type",
+      data: [
+        {
+          label: "成品",
+          value: "1",
+        },
+        {
+          label: "半成品",
+          value: "2",
+        },
+      ],
+    },
+    {
+      label: "生命周期",
+      prop: "lifeCycle",
+      data: [
+        {
+          label: "新品",
+          value: "1",
+        },
+        {
+          label: "成长",
+          value: "2",
+        },
+        {
+          label: "成熟",
+          value: "3",
+        },
+      ],
+    },
+  ];
+});
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "产品类型",
+        prop: "type",
+      },
+      render(type) {
+        return type == 1 ? "成品" : type == 2 ? "半成品" : "";
+      },
+    },
+    {
+      attrs: {
+        label: "产品编码",
+        prop: "code",
+      },
+    },
+    {
+      attrs: {
+        label: "产品名称",
+        prop: "name",
+      },
+    },
+    {
+      attrs: {
+        label: "图片",
+        prop: "unit",
+        slot: "pic",
+      },
+    },
+    {
+      attrs: {
+        label: "单位",
+        prop: "unit",
+      },
+    },
+    {
+      attrs: {
+        label: "规格型号",
+        prop: "spec",
+      },
+    },
+    {
+      attrs: {
+        label: "管理部门",
+        prop: "deptName",
+      },
+    },
+    {
+      attrs: {
+        label: "生命周期",
+        prop: "lifeCycle",
+      },
+    },
+    {
+      attrs: {
+        label: "京东供价",
+        prop: "jdPurchasePrice",
+      },
+    },
+    {
+      attrs: {
+        label: "标准售价",
+        prop: "sellingPrice",
+      },
+    },
+    {
+      attrs: {
+        label: "标准采购价",
+        prop: "purchasePrice",
+      },
+    },
+    {
+      attrs: {
+        label: "产品备注",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "100",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "选择",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              handleSelect(row);
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+
+const uploadData = ref({});
+const fileList = ref([]);
+const fileListCopy = ref([]);
+
+let formData = reactive({
+  data: {},
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const treeListData = ref([]);
+const formConfig = computed(() => {
+  return [
+    {
+      type: "treeSelect",
+      prop: "productClassifyId",
+      label: "产品分类",
+      data: [],
+    },
+    {
+      type: "select",
+      prop: "type",
+      label: "产品类型",
+      required: true,
+      data: [
+        {
+          label: "成品",
+          id: "1",
+        },
+        {
+          label: "半成品",
+          id: "2",
+        },
+      ],
+    },
+    {
+      type: "input",
+      prop: "name",
+      label: "产品名称",
+    },
+    {
+      type: "input",
+      prop: "spec",
+      label: "规格型号",
+    },
+    {
+      type: "select",
+      prop: "unit",
+      label: "单位",
+      required: true,
+      data: [
+        {
+          label: "个",
+          id: "个",
+        },
+        {
+          label: "双",
+          id: "双",
+        },
+      ],
+    },
+    {
+      type: "slot",
+      slotName: "productPic",
+      prop: "fileList",
+      label: "产品图片",
+    },
+    {
+      type: "input",
+      prop: "remark",
+      label: "备注",
+      itemType: "textarea",
+    },
+    {
+      type: "radio",
+      prop: "combination",
+      label: "是否组合",
+      required: true,
+      border: true,
+      data: [
+        { label: "是", value: "1" },
+        { label: "否", value: "0" },
+      ],
+    },
+    {
+      type: "json",
+      prop: "victoriatouristJson",
+      json: [
+        {
+          type: "input",
+          prop: "jdPurchasePrice",
+          label: "京东供价",
+          itemWidth: 33,
+          style: {
+            width: "100%",
+            "margin-right": "10px",
+          },
+        },
+        {
+          type: "input",
+          prop: "sellingPrice",
+          label: "标准售价",
+          itemWidth: 33,
+        },
+        {
+          type: "input",
+          prop: "purchasePrice",
+          label: "标准采购价",
+          itemWidth: 33,
+        },
+        {
+          type: "date",
+          prop: "clearancePeriod",
+          label: "库存清空期限",
+          itemWidth: 50,
+          format: "YYYY-MM-DD",
+        },
+      ],
+    },
+    // {
+    //   type: "title",
+    //   title: "组合明细",
+    //   label: "",
+    // },
+    {
+      type: "slot",
+      slotName: "combination",
+      label: "",
+    },
+    {
+      type: "title",
+      title: "生命周期规则",
+      label: "",
+    },
+    {
+      type: "slot",
+      slotName: "one",
+      label: "新品期",
+    },
+    {
+      type: "slot",
+      slotName: "two",
+      label: "成长期",
+    },
+    {
+      type: "slot",
+      slotName: "three",
+      label: "成熟期",
+    },
+  ];
+});
+const newPassword = () => {
+  formData.data.password = generatePassword();
+};
+const generatePassword = () => {
+  var length = 12,
+    charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
+    password = "";
+  for (var i = 0, n = charset.length; i < length; ++i) {
+    password += charset.charAt(Math.floor(Math.random() * n));
+  }
+  return password;
+};
+
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/productInfo/page", sourceList.value.pagination)
+    .then((message) => {
+      console.log(message);
+      sourceList.value.data = message.rows.map((x) => ({
+        ...x,
+        fileList: [],
+        ...JSON.parse(x.victoriatouristJson),
+      }));
+      sourceList.value.pagination.total = message.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+
+      const productIdList = message.rows.map((x) => x.id);
+      // 请求文件数据并回显
+      if (productIdList.length > 0) {
+        proxy
+          .post("/fileInfo/getList", { businessIdList: productIdList })
+          .then((fileObj) => {
+            for (let i = 0; i < sourceList.value.data.length; i++) {
+              const e = sourceList.value.data[i];
+              for (const key in fileObj) {
+                if (e.id === key) {
+                  e.fileList = fileObj[key];
+                }
+              }
+            }
+          });
+      }
+    });
+};
+
+const treeChange = (e) => {
+  console.log(e);
+  sourceList.value.pagination.productClassifyId = e.id;
+  getList({ productClassifyId: e.id });
+};
+
+const openModal = () => {
+  dialogVisible.value = true;
+  modalType.value = "add";
+  formData.data = {
+    definition: "1",
+    type: "1",
+    fileList: [],
+    combination: "1",
+    victoriatouristJson: {
+      combination: 1,
+      newProductsDay1: 0,
+      newProductsDay: 60,
+      growUpDay1: 61,
+      growUpDay: 120,
+      attDay: 120,
+    },
+    productCombinationList: [],
+  };
+  fileList.value = [];
+  fileListCopy.value = [];
+};
+
+const openExcel = () => {
+  openExcelDialog.value = true;
+};
+const submitExcel = () => {
+  openExcelDialog.value = false;
+};
+const TreetenantId = ref("");
+const selection = ref({
+  data: [],
+});
+const select = (_selection, row) => {
+  selection.value.data = _selection;
+  console.log(_selection.length);
+};
+
+const tree = ref(null);
+const submitForm = () => {
+  byform.value.handleSubmit((valid) => {
+    if (formData.data.combination == 1) {
+      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.fileList = fileListCopy.value.map((x) => ({
+      id: x.id,
+      fileName: x.fileName,
+    }));
+    submitLoading.value = true;
+    proxy.post("/productInfo/" + 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 getTreeList = () => {
+  proxy
+    .post("/productClassify/tree", { parentId: "", name: "", definition: "1" })
+    .then((message) => {
+      treeListData.value = message;
+      formConfig.value[0].data = message;
+    });
+};
+
+const getDtl = (row) => {
+  modalType.value = "edit";
+  proxy.post("/productInfo/detail", { id: row.id }).then((res) => {
+    fileList.value = row.fileList.map((x) => ({ ...x, url: x.fileUrl }));
+    fileListCopy.value = [...fileList.value];
+    res.type = res.type + ""; //type回显
+    res.definition = "1"; //产品
+    res.victoriatouristJson = JSON.parse(res.victoriatouristJson);
+    res.combination = res.victoriatouristJson.combination + "";
+    res.productCombinationList = res.victoriatouristJson.productCombinationList;
+    formData.data = res;
+    dialogVisible.value = true;
+  });
+};
+getTreeList();
+getList();
+const handleBeforeUpload = async (file) => {
+  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
+  uploadData.value = res.uploadBody;
+  fileListCopy.value.push({
+    id: res.id,
+    fileName: res.fileName,
+    path: res.fileUrl,
+    url: res.fileUrl,
+    uid: file.uid,
+  });
+};
+
+const handleSuccess = (res, file, files) => {
+  // 查当前file的index值去赋值对应的copy变量的值
+  // let uid = file.uid;
+  // const index = fileList.value.findIndex((x) => x.uid === uid);
+  // fileListCopy.value[index].uid = uid;
+};
+
+const handleRemove = (file) => {
+  const index = fileListCopy.value.findIndex(
+    (x) => x.uid === file.uid || x.id === file.id
+  );
+  fileListCopy.value.splice(index, 1);
+};
+
+const handleClickFile = (file) => {
+  window.open(file.fileUrl, "_blank");
+};
+
+const handleRemoveProduct = (index) => {
+  formData.data.productCombinationList.splice(index, 1);
+  return ElMessage({
+    message: "删除成功!",
+    type: "success",
+  });
+};
+
+const pushGoods = (goods) => {
+  const arr = goods.map((x) => ({
+    linkProductId: x.id,
+    linkQuantity: "",
+    name: x.name,
+    code: x.code,
+  }));
+  formData.data.productCombinationList =
+    formData.data.productCombinationList.concat(arr);
+  return ElMessage({
+    message: "添加成功!",
+    type: "success",
+  });
+};
+
+const changeDay = (type) => {
+  if (type == 10) {
+    formData.data.victoriatouristJson.growUpDay1 =
+      Number(formData.data.victoriatouristJson.newProductsDay) + 1;
+  } else if (type == 20) {
+    formData.data.victoriatouristJson.attDay = Number(
+      formData.data.victoriatouristJson.growUpDay
+    );
+  }
+};
+const handleSelect = (row) => {
+  proxy.$emit("handleSelect", toRaw(row));
+};
+</script>
+  
+<style lang="scss" scoped>
+.user {
+  padding: 20px;
+  display: flex;
+  justify-content: space-between;
+  .tree {
+    width: 300px;
+  }
+  .content {
+    // width: calc(100% - 320px);
+    // flex: 1;
+    width: 100%;
+  }
+}
+.pic {
+  object-fit: contain;
+  width: 50px;
+  height: 50px;
+  cursor: pointer;
+  vertical-align: middle;
+}
+</style>

+ 135 - 83
src/views/WDLY/basic/product/index.vue

@@ -85,7 +85,10 @@
             :rules="rules"
             style="margin-top: 15px"
           >
-            <el-form-item label="组合明细" v-if="formData.data.combination">
+            <el-form-item
+              label="组合明细"
+              v-show="formData.data.combination == 1"
+            >
               <el-button
                 type="primary"
                 @click="openProduct = true"
@@ -128,83 +131,83 @@
                 </el-table-column>
               </el-table>
             </el-form-item>
-
-            <div>生命周期规则</div>
-            <el-form-item label="新品期">
-              <el-row>
-                <el-col :span="4">
-                  <el-input
-                    v-model="formData.data.victoriatouristJson.newProductsDay1"
-                    placeholder="请输入"
-                    disabled
-                  />
-                </el-col>
-                <el-col :span="1" style="text-align: center"> ~ </el-col>
-                <el-col :span="4">
-                  <el-input
-                    v-model="formData.data.victoriatouristJson.newProductsDay"
-                    placeholder="请输入"
-                    @change="changeDay(10)"
-                  >
-                  </el-input>
-                </el-col>
-                <el-col :span="1" style="text-align: center"> : </el-col>
-                <el-col :span="6">
-                  <el-input
-                    v-model="
-                      formData.data.victoriatouristJson.newProductsExpectedSales
-                    "
-                    placeholder="预期销量"
-                  />
-                </el-col>
-              </el-row>
-            </el-form-item>
-            <el-form-item label="成长期">
-              <el-row>
-                <el-col :span="4">
-                  <el-input
-                    v-model="formData.data.victoriatouristJson.growUpDay1"
-                    placeholder="请输入"
-                    disabled
-                  />
-                </el-col>
-                <el-col :span="1" style="text-align: center"> ~ </el-col>
-                <el-col :span="4">
-                  <el-input
-                    v-model="formData.data.victoriatouristJson.growUpDay"
-                    placeholder="请输入"
-                    @change="changeDay(20)"
-                  >
-                  </el-input>
-                </el-col>
-                <el-col :span="1" style="text-align: center"> : </el-col>
-                <el-col :span="6">
-                  <el-input
-                    v-model="
-                      formData.data.victoriatouristJson.growUpExpectedSales
-                    "
-                    placeholder="预期销量"
-                  />
-                </el-col>
-              </el-row>
-            </el-form-item>
-            <el-form-item label="成熟期">
-              <el-row style="width: 100%">
-                <el-col :span="5">
-                  大于{{ formData.data.victoriatouristJson.attDay }}天:
-                </el-col>
-                <el-col :span="6">
-                  <el-input
-                    v-model="
-                      formData.data.victoriatouristJson.matureExpectedSales
-                    "
-                    placeholder="预期销量"
-                  />
-                </el-col>
-              </el-row>
-            </el-form-item>
           </el-form>
         </template>
+        <template #one>
+          <div style="width: 100%">
+            <el-row>
+              <el-col :span="4">
+                <el-input
+                  v-model="formData.data.victoriatouristJson.newProductsDay1"
+                  placeholder="请输入"
+                  disabled
+                />
+              </el-col>
+              <el-col :span="1" style="text-align: center"> ~ </el-col>
+              <el-col :span="4">
+                <el-input
+                  v-model="formData.data.victoriatouristJson.newProductsDay"
+                  placeholder="请输入"
+                  @change="changeDay(10)"
+                >
+                </el-input>
+              </el-col>
+              <el-col :span="1" style="text-align: center"> : </el-col>
+              <el-col :span="6">
+                <el-input
+                  v-model="
+                    formData.data.victoriatouristJson.newProductsExpectedSales
+                  "
+                  placeholder="预期销量"
+                />
+              </el-col>
+            </el-row>
+          </div>
+        </template>
+        <template #two>
+          <div style="width: 100%">
+            <el-row>
+              <el-col :span="4">
+                <el-input
+                  v-model="formData.data.victoriatouristJson.growUpDay1"
+                  placeholder="请输入"
+                  disabled
+                />
+              </el-col>
+              <el-col :span="1" style="text-align: center"> ~ </el-col>
+              <el-col :span="4">
+                <el-input
+                  v-model="formData.data.victoriatouristJson.growUpDay"
+                  placeholder="请输入"
+                  @change="changeDay(20)"
+                >
+                </el-input>
+              </el-col>
+              <el-col :span="1" style="text-align: center"> : </el-col>
+              <el-col :span="6">
+                <el-input
+                  v-model="
+                    formData.data.victoriatouristJson.growUpExpectedSales
+                  "
+                  placeholder="预期销量"
+                />
+              </el-col>
+            </el-row>
+          </div>
+        </template>
+        <template #three>
+          <el-row style="width: 100%">
+            <el-col :span="5">
+              大于{{ formData.data.victoriatouristJson.attDay }}天:
+            </el-col>
+            <el-col :span="6">
+              <el-input
+                v-model="formData.data.victoriatouristJson.matureExpectedSales"
+                placeholder="预期销量"
+              />
+            </el-col>
+          </el-row>
+        </template>
       </byForm>
       <template #footer>
         <el-button @click="dialogVisible = false" size="large">取 消</el-button>
@@ -240,14 +243,16 @@
     </el-dialog>
     <el-dialog
       v-model="openProduct"
-      title="选择品"
+      title="选择品"
       width="70%"
       append-to-body
     >
-      <SelectGoods
-        @cancel="openProduct = false"
-        @pushGoods="pushGoods"
-      ></SelectGoods>
+      <SelectProduct @handleSelect="handleSelect"></SelectProduct>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="openProduct = false">取消</el-button>
+        </span>
+      </template>
     </el-dialog>
   </div>
 </template>
@@ -258,7 +263,7 @@ import { ElMessage, ElMessageBox } from "element-plus";
 import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import treeList from "@/components/product/treeList";
-import SelectGoods from "@/components/product/SelectGoods";
+import SelectProduct from "@/components/WDLY/product/SelectProduct";
 
 import { computed, defineComponent, ref } from "vue";
 let openProduct = ref(false);
@@ -584,16 +589,41 @@ const formConfig = computed(() => {
           type: "date",
           prop: "clearancePeriod",
           label: "库存清空期限",
-          itemWidth: 33.33,
+          itemWidth: 50,
           format: "YYYY-MM-DD",
         },
       ],
     },
+    // {
+    //   type: "title",
+    //   title: "组合明细",
+    //   label: "",
+    // },
     {
       type: "slot",
       slotName: "combination",
       label: "",
     },
+    {
+      type: "title",
+      title: "生命周期规则",
+      label: "",
+    },
+    {
+      type: "slot",
+      slotName: "one",
+      label: "新品期",
+    },
+    {
+      type: "slot",
+      slotName: "two",
+      label: "成长期",
+    },
+    {
+      type: "slot",
+      slotName: "three",
+      label: "成熟期",
+    },
   ];
 });
 const newPassword = () => {
@@ -820,6 +850,28 @@ const changeDay = (type) => {
     );
   }
 };
+
+const handleSelect = (row) => {
+  const flag = formData.data.productCombinationList.some(
+    (x) => x.linkProductId === row.id
+  );
+  if (flag)
+    return ElMessage({
+      message: "该产品已选择",
+      type: "info",
+    });
+  const product = {
+    linkProductId: row.id,
+    linkQuantity: "",
+    name: row.name,
+    code: row.code,
+  };
+  formData.data.productCombinationList.push(product);
+  return ElMessage({
+    message: "选择成功",
+    type: "success",
+  });
+};
 </script>
   
 <style lang="scss" scoped>

+ 1 - 1
src/views/WDLY/basic/spu/index.vue

@@ -97,7 +97,7 @@ 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/product/SelectProduct";
+import SelectProduct from "@/components/WDLY/product/SelectProduct";
 
 const loading = ref(false);
 const submitLoading = ref(false);

+ 514 - 0
src/views/WDLY/outInBound/logistics/index.vue

@@ -0,0 +1,514 @@
+<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 #one="{ item }">
+          <div style="cursor: pointer; color: #409eff">
+            {{ item.fileName }}
+          </div>
+        </template>
+        <template #two="{ item }">
+          <div
+            style="cursor: pointer; color: #409eff"
+            @click="handleClickCode(item)"
+          >
+            {{ item.code }}
+          </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 #products>
+          <div style="width: 100%">
+            <el-button
+              type="primary"
+              @click="openProduct = true"
+              style="margin-bottom: 10px"
+            >
+              添加物品
+            </el-button>
+            <el-table :data="formData.data.stockWaitDetailsList">
+              <el-table-column prop="name" label="物品编码" />
+              <el-table-column prop="name" label="物品名称" />
+              <el-table-column prop="name" label="规格型号" />
+              <el-table-column
+                prop="name"
+                label="调仓数量"
+                v-if="modalType == 'edit'"
+              />
+              <el-table-column
+                prop="quantity"
+                label="调仓数量"
+                min-width="150"
+                v-if="modalType == 'add'"
+              >
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="'stockWaitDetailsList.' + $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="quantity"
+                label="接收数量"
+                min-width="150"
+                v-if="modalType == 'edit'"
+              >
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="'stockWaitDetailsList.' + $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">
+                <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 title="物流数据" v-model="openRecord" width="40%" top="50px">
+      <!-- <div style="padding-left: 40px; margin-bottom: 20px">
+        <el-button size="mini" @click="handleAddRecord">
+          添加物流记录
+        </el-button>
+      </div> -->
+      <div>
+        <el-timeline :reverse="false">
+          <el-timeline-item
+            placement="top"
+            v-for="(activity, index) in activities"
+            :key="index"
+            :timestamp="activity.ftime"
+          >
+            {{ activity.context }}
+          </el-timeline-item>
+        </el-timeline>
+      </div>
+    </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";
+
+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 openRecord = ref(false);
+const activities = ref([]);
+
+let roomDialogVisible = ref(false);
+let modalType = ref("add");
+let rules = ref({
+  code: [{ required: true, message: "请输入spu编码", trigger: "blur" }],
+  name: [{ required: true, message: "请输入spu名称", trigger: "blur" }],
+});
+const { proxy } = getCurrentInstance();
+const selectConfig = reactive([
+  {
+    label: "数据来源",
+    prop: "type",
+    data: [],
+  },
+  {
+    label: "物流状态",
+    prop: "type",
+    data: [],
+  },
+  {
+    label: "完成状态",
+    prop: "type",
+    data: [
+      {
+        label: "待接收",
+        value: "1",
+      },
+      {
+        label: "部分接收",
+        value: "2",
+      },
+      {
+        label: "已接收",
+        value: "2",
+      },
+    ],
+  },
+]);
+
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "数据来源",
+        prop: "code",
+      },
+    },
+    {
+      attrs: {
+        label: "关联单号",
+        prop: "name",
+        slot: "one",
+      },
+    },
+    {
+      attrs: {
+        label: "物流/快递公司",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "物流/快递单号",
+        prop: "remark",
+        slot: "two",
+      },
+    },
+    {
+      attrs: {
+        label: "物流状态",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "创建时间",
+        prop: "remark",
+      },
+    },
+
+    {
+      attrs: {
+        label: "操作",
+        width: "200",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "修改",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row);
+            },
+          },
+          {
+            attrs: {
+              label: "更新状态",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row);
+            },
+          },
+          {
+            attrs: {
+              label: "到货通知",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row);
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+
+let formData = reactive({
+  data: {},
+  treeData: [],
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const treeData = ref([]);
+const formConfig = reactive([
+  {
+    type: "select",
+    prop: "warehouseId",
+    label: "数据来源",
+    data: [],
+    itemWidth: 61,
+  },
+  {
+    type: "select",
+    prop: "warehouseId",
+    label: "物流/快递信息",
+    data: [],
+    itemWidth: 40,
+    style: {
+      width: "100%",
+    },
+  },
+  {
+    type: "input",
+    prop: "warehouseId",
+    label: " ",
+    itemWidth: 60,
+  },
+  {
+    type: "radio",
+    prop: "type",
+    label: "是否同步",
+    required: true,
+    border: true,
+    data: [
+      { label: "是", value: "1" },
+      { label: "否", value: "2" },
+    ],
+  },
+  {
+    type: "input",
+    prop: "name",
+    label: "备注",
+    itemType: "textarea",
+  },
+]);
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/productSpu/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 = {
+    stockWaitDetailsList: [],
+  };
+};
+
+const submitForm = () => {
+  console.log(byform.value);
+  byform.value.handleSubmit((valid) => {
+    submitLoading.value = true;
+    proxy.post("/productSpu/" + 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) => {
+  modalType.value = "edit";
+  proxy.post("/productSpu/detail", { id: row.id }).then((res) => {
+    res.stockWaitDetailsList = res.productInfoList;
+    formData.data = res;
+    dialogVisible.value = true;
+  });
+};
+
+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,
+      }));
+      formConfig[2].data = message.rows.map((x) => ({
+        label: x.name,
+        value: x.id,
+      }));
+      selectConfig[0].data = message.rows.map((x) => ({
+        label: x.name,
+        value: x.id,
+      }));
+      selectConfig[1].data = message.rows.map((x) => ({
+        label: x.name,
+        value: x.id,
+      }));
+    });
+};
+
+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[1].data = logisticsData.value.map((x) => ({
+      label: x.name,
+      value: x.code,
+    }));
+  });
+};
+
+getList();
+getLogisticsData();
+
+const handleSelect = (row) => {
+  const flag = formData.data.stockWaitDetailsList.some((x) => x.id === row.id);
+  if (flag)
+    return ElMessage({
+      message: "该物品已选择",
+      type: "info",
+    });
+  formData.data.stockWaitDetailsList.push({
+    name: row.name,
+    code: row.code,
+    id: row.id,
+  });
+  return ElMessage({
+    message: "选择成功",
+    type: "success",
+  });
+};
+
+const handleRemove = (index) => {
+  formData.data.stockWaitDetailsList.splice(index, 1);
+  return ElMessage({
+    message: "删除成功",
+    type: "success",
+  });
+};
+
+const handleClickCode = (row) => {
+  ElMessage({
+    message: "数据请求中,请稍后!",
+    type: "success",
+  });
+  let id = row.id;
+  // proxy.post("/fileInfo/getList", { businessIdList: [id] }).then((res) => {
+  //   const file = res[id][0];
+  //   window.open(file.fileUrl, "_blank");
+  // });
+  openRecord.value = true;
+};
+</script>
+  
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+</style>

+ 451 - 0
src/views/WDLY/outInBound/transfer/index.vue

@@ -0,0 +1,451 @@
+<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 #slotName="{ item }">
+          {{ item.createTime }}
+        </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 #products>
+          <div style="width: 100%">
+            <el-button
+              type="primary"
+              @click="openProduct = true"
+              style="margin-bottom: 10px"
+            >
+              添加物品
+            </el-button>
+            <el-table :data="formData.data.stockWaitDetailsList">
+              <el-table-column prop="name" label="物品编码" />
+              <el-table-column prop="name" label="物品名称" />
+              <el-table-column prop="name" label="规格型号" />
+              <el-table-column
+                prop="name"
+                label="调仓数量"
+                v-if="modalType == 'edit'"
+              />
+              <el-table-column
+                prop="quantity"
+                label="调仓数量"
+                min-width="150"
+                v-if="modalType == 'add'"
+              >
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="'stockWaitDetailsList.' + $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="quantity"
+                label="接收数量"
+                min-width="150"
+                v-if="modalType == 'edit'"
+              >
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="'stockWaitDetailsList.' + $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">
+                <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>
+  </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";
+
+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 roomDialogVisible = ref(false);
+let modalType = ref("add");
+let rules = ref({
+  code: [{ required: true, message: "请输入spu编码", trigger: "blur" }],
+  name: [{ required: true, message: "请输入spu名称", trigger: "blur" }],
+});
+const { proxy } = getCurrentInstance();
+const selectConfig = reactive([
+  {
+    label: "调出仓库",
+    prop: "type",
+    data: [],
+  },
+  {
+    label: "调入仓库",
+    prop: "type",
+    data: [],
+  },
+  {
+    label: "接收状态",
+    prop: "type",
+    data: [
+      {
+        label: "待接收",
+        value: "1",
+      },
+      {
+        label: "部分接收",
+        value: "2",
+      },
+      {
+        label: "已接收",
+        value: "2",
+      },
+    ],
+  },
+]);
+
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "单号",
+        prop: "code",
+      },
+    },
+    {
+      attrs: {
+        label: "调出仓库",
+        prop: "name",
+      },
+    },
+    {
+      attrs: {
+        label: "调出人",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "调出时间",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "接收状态",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "调入仓库",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "接收人",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "接收时间",
+        prop: "remark",
+      },
+    },
+
+    {
+      attrs: {
+        label: "操作",
+        width: "200",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "接收",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row);
+            },
+          },
+          {
+            attrs: {
+              label: "打印",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row);
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+
+let formData = reactive({
+  data: {},
+  treeData: [],
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const treeData = ref([]);
+const formConfig = reactive([
+  {
+    type: "title",
+    title: "调仓信息",
+  },
+  {
+    type: "select",
+    prop: "warehouseId",
+    label: "调出仓库",
+    itemWidth: 33,
+    disabled: modalType.value === "edit",
+    data: [],
+  },
+  {
+    type: "select",
+    prop: "warehouseId",
+    label: "调入仓库",
+    itemWidth: 33,
+    disabled: modalType.value === "edit",
+    data: [],
+  },
+  {
+    type: "input",
+    prop: "name",
+    label: "调拨说明",
+    itemType: "textarea",
+    disabled: modalType.value === "edit",
+  },
+  {
+    type: "title",
+    title: "调仓明细",
+  },
+  {
+    type: "slot",
+    slotName: "products",
+  },
+]);
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/productSpu/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 = {
+    stockWaitDetailsList: [],
+  };
+};
+
+const submitForm = () => {
+  console.log(byform.value);
+  byform.value.handleSubmit((valid) => {
+    submitLoading.value = true;
+    proxy.post("/productSpu/" + 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) => {
+  modalType.value = "edit";
+  proxy.post("/productSpu/detail", { id: row.id }).then((res) => {
+    res.stockWaitDetailsList = res.productInfoList;
+    formData.data = res;
+    dialogVisible.value = true;
+  });
+};
+
+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,
+      }));
+      formConfig[2].data = message.rows.map((x) => ({
+        label: x.name,
+        value: x.id,
+      }));
+      selectConfig[0].data = message.rows.map((x) => ({
+        label: x.name,
+        value: x.id,
+      }));
+      selectConfig[1].data = message.rows.map((x) => ({
+        label: x.name,
+        value: x.id,
+      }));
+    });
+};
+getList();
+warehouseListData();
+
+const handleSelect = (row) => {
+  const flag = formData.data.stockWaitDetailsList.some((x) => x.id === row.id);
+  if (flag)
+    return ElMessage({
+      message: "该物品已选择",
+      type: "info",
+    });
+  formData.data.stockWaitDetailsList.push({
+    name: row.name,
+    code: row.code,
+    id: row.id,
+  });
+  return ElMessage({
+    message: "选择成功",
+    type: "success",
+  });
+};
+
+const handleRemove = (index) => {
+  formData.data.stockWaitDetailsList.splice(index, 1);
+  return ElMessage({
+    message: "删除成功",
+    type: "success",
+  });
+};
+</script>
+  
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+</style>

+ 4 - 3
src/views/WDLY/outInBound/waitInBound/index.vue

@@ -144,7 +144,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "单号",
-        prop: "code",
+        prop: "businessCode",
       },
     },
 
@@ -277,6 +277,7 @@ const getList = async (req) => {
       }, 200);
     });
 };
+
 const openModal = () => {
   dialogVisible.value = true;
   modalType.value = "add";
@@ -295,9 +296,9 @@ const submitForm = () => {
     }
     for (let i = 0; i < list.length; i++) {
       const e = list[i];
-      if (Number(e.receiptQuantity) + e.quantity > Number(e.purchaseQuantity)) {
+      if (Number(e.receiptQuantity) + e.quantity > Number(e.arrivalQuantity)) {
         return ElMessage({
-          message: "本次入库加已入库数量不可大于货数量!",
+          message: "本次入库加已入库数量不可大于货数量!",
           type: "info",
         });
       }

+ 646 - 0
src/views/WDLY/salesMange/afterSale/index.vue

@@ -0,0 +1,646 @@
+<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 #address="{ item }">
+          <div>
+            {{ item.countryName }}, {{ item.provinceName }} ,
+            {{ item.cityName }}, {{ item.areaDetail }}
+          </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 :gutter="10" 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="areaDetail">
+                <el-input v-model="formData.data.areaDetail" 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.stockWaitDetailsList">
+              <el-table-column prop="name" label="产品名称" />
+              <el-table-column prop="name" label="可拆分数量" />
+              <el-table-column prop="quantity" label="本次拆分" min-width="150">
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="'stockWaitDetailsList.' + $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">
+                <template #default="{ $index }">
+                  <el-button type="primary" link @click="handleRemove($index)"
+                    >删除</el-button
+                  >
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </template>
+        <template #fileSlot>
+          <div>
+            <el-upload
+              v-model:fileList="fileList"
+              :show-file-list="false"
+              class="upload-demo"
+              action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
+              :data="uploadData"
+              :on-preview="handlePreview"
+              :on-remove="handleRemove"
+              :on-success="handleSuccess"
+              :before-upload="handleBeforeUpload"
+            >
+              <el-button type="primary">选择</el-button>
+            </el-upload>
+            <div>
+              <div style="margin-top: 15px">
+                <el-tag
+                  style="margin-right: 10px"
+                  class="ml-2"
+                  type="info"
+                  v-for="(item, index) in fileListCopy"
+                  :key="index"
+                  closable
+                  @close="handleClose(index)"
+                  >{{ item.fileName }}</el-tag
+                >
+              </div>
+            </div>
+          </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="dialogVisibleOne"
+      title="跟进记录"
+      width="70%"
+      append-to-body
+    >
+      <div style="padding-left: 40px; margin-bottom: 20px">
+        <el-button size="mini" @click="openModal('edit')">
+          添加物流记录
+        </el-button>
+      </div>
+      <div>
+        <el-timeline :reverse="false">
+          <el-timeline-item
+            placement="top"
+            v-for="(activity, index) in activities"
+            :key="index"
+            :timestamp="activity.handleTime"
+          >
+            <div>
+              跟进人:{{ activity.handleUserName }}
+              <span>({{ activity.status ? "已完成" : "处理中" }})</span>
+            </div>
+            <div style="margin-top: 5px">跟进记录: {{ activity.explain }}</div>
+          </el-timeline-item>
+        </el-timeline>
+      </div>
+    </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 FileUpload from "@/components/FileUpload/index";
+import { computed, defineComponent, ref } from "vue";
+import { getToken } from "@/utils/auth";
+import SelectProduct from "@/components/WDLY/product/SelectProduct";
+
+const uploadFileUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); // 上传文件服务器地址
+const headers = ref({ Authorization: "Bearer " + getToken() });
+const uploadData = ref({});
+const loading = ref(false);
+const submitLoading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+    type: "",
+    keyword: "",
+  },
+});
+let dialogVisible = ref(false);
+let dialogVisibleOne = ref(false);
+let activities = ref([]);
+let openProduct = ref(false);
+let modalType = ref("add");
+let fileList = ref([]);
+let fileListCopy = ref([]);
+
+const checkContactNumber = (rule, val, callback) => {
+  if (val === "") {
+    callback(new Error("请输入联系电话"));
+  } else {
+    val = "aaa";
+  }
+  console.log(rule, val, callback, "213");
+  // @input="(val) => val.replace(/[^\d]/g, '')"
+};
+let rules = ref({
+  name: [{ required: true, message: "请输入供应商名称", trigger: "blur" }],
+  type: [{ required: true, message: "请选择供应商类型", trigger: "change" }],
+  countryId: [{ required: true, message: "请选择国家", trigger: "change" }],
+  provinceId: [{ required: true, message: "请选择省/洲", trigger: "change" }],
+  cityId: [{ required: true, message: "请选择城市", trigger: "change" }],
+  areaDetail: [{ required: true, message: "请输入详细地址", trigger: "blur" }],
+  contactPerson: [{ required: true, message: "请输入联系人", trigger: "blur" }],
+  // contactNumber: [{ validator: checkContactNumber, trigger: "blur" }],
+  contactNumber: [
+    { required: true, message: "请输入联系电话", trigger: "blur" },
+  ],
+});
+const { proxy } = getCurrentInstance();
+const selectConfig = reactive([
+  {
+    label: "售后类型",
+    prop: "type",
+    data: [
+      {
+        label: "贸易商",
+        value: "1",
+      },
+      {
+        label: "工厂",
+        value: "2",
+      },
+    ],
+  },
+  {
+    label: "售后状态",
+    prop: "accountPeriodType",
+    data: [
+      {
+        label: "有",
+        value: "1",
+      },
+      {
+        label: "无",
+        value: "0",
+      },
+    ],
+  },
+]);
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "售后类型",
+        prop: "type",
+      },
+      render(type) {
+        return type === 1 ? "贸易商" : "工厂";
+      },
+    },
+    {
+      attrs: {
+        label: "客户名称",
+        prop: "name",
+      },
+    },
+    {
+      attrs: {
+        label: "售后时间",
+        prop: "name",
+      },
+    },
+    {
+      attrs: {
+        label: "所在城市",
+        prop: "remarks",
+        slot: "address",
+      },
+    },
+    {
+      attrs: {
+        label: "售后原因",
+        prop: "name",
+      },
+    },
+
+    {
+      attrs: {
+        label: "售后状态",
+        prop: "returnPeriod",
+      },
+    },
+
+    {
+      attrs: {
+        label: "操作",
+        width: "100",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "跟进记录",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              openModalOne(row);
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+
+let formData = reactive({
+  data: {
+    type: "1",
+  },
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const configData = [
+  [
+    {
+      type: "select",
+      prop: "name",
+      label: "售后类型",
+      required: true,
+      itemWidth: 51,
+    },
+    {
+      type: "select",
+      prop: "name",
+      label: "客户名称",
+      required: true,
+      itemWidth: 51,
+    },
+    {
+      type: "slot",
+      slotName: "address",
+      prop: "countryId",
+      label: "详细地址",
+      required: true,
+    },
+    {
+      type: "input",
+      label: "售后原因",
+      prop: "remark",
+      itemType: "textarea",
+    },
+    {
+      type: "slot",
+      slotName: "products",
+      label: "关联商品",
+    },
+  ],
+  [
+    {
+      type: "select",
+      prop: "name",
+      label: "售后状态",
+      required: true,
+      itemWidth: 51,
+    },
+    {
+      type: "select",
+      prop: "name",
+      label: "跟进人",
+      required: true,
+      itemWidth: 50,
+    },
+    {
+      type: "date",
+      prop: "name",
+      itemType: "date",
+      label: "跟进时间",
+      required: true,
+      itemWidth: 50,
+    },
+    {
+      type: "select",
+      prop: "name",
+      label: "下一跟进人",
+      required: true,
+      itemWidth: 51,
+    },
+    {
+      type: "input",
+      label: "跟进记录",
+      prop: "remark",
+      itemType: "textarea",
+    },
+    {
+      type: "slot",
+      slotName: "fileSlot",
+      label: "上传附件",
+    },
+  ],
+];
+let formConfig = reactive([]);
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/supplierInfo/pageByWdly", sourceList.value.pagination)
+    .then((message) => {
+      console.log(message);
+      sourceList.value.data = message.rows.map((x) => ({
+        ...x,
+        ...JSON.parse(x.victoriatouristJson),
+      }));
+      sourceList.value.pagination.total = message.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
+};
+const openModal = (type, row = {}) => {
+  modalType.value = type;
+  if (type == "add") {
+    formConfig = configData[0];
+    formData.data = {
+      type: "1",
+      countryId: "China",
+    };
+    getCityData(formData.data.countryId, "20");
+  } else if (type == "edit") {
+    formConfig = configData[1];
+  }
+  dialogVisible.value = true;
+};
+
+const openModalOne = (row) => {
+  dialogVisibleOne.value = true;
+};
+
+const submitForm = () => {
+  byform.value.handleSubmit((valid) => {
+    formData.data.fileList =
+      fileListCopy.value.map((x) => ({
+        id: x.id,
+        fileName: x.fileName,
+      })) || [];
+    submitLoading.value = true;
+    proxy.post("/supplierInfo/" + modalType.value, formData.data).then(
+      (res) => {
+        ElMessage({
+          message: modalType.value == "add" ? "添加成功" : "编辑成功",
+          type: "success",
+        });
+        fileList.value = [];
+        dialogVisible.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      (err) => {
+        submitLoading.value = false;
+      }
+    );
+  });
+};
+
+const getDtl = (row) => {
+  modalType.value = "edit";
+  proxy.post("/supplierInfo/detail", { id: row.id }).then((res) => {
+    proxy
+      .post("/fileInfo/getList", { businessIdList: [row.id] })
+      .then((fileObj) => {
+        fileList.value = fileObj[row.id] || [];
+        fileListCopy.value = [...fileList.value];
+        getCityData(res.countryId, "20");
+        getCityData(res.provinceId, "30");
+        res.type = res.type + "";
+        res.victoriatouristJson = JSON.parse(res.victoriatouristJson);
+        formData.data = res;
+        dialogVisible.value = true;
+      });
+  });
+};
+
+const handleBeforeUpload = async (file) => {
+  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
+  uploadData.value = res.uploadBody;
+  fileListCopy.value.push({
+    id: res.id,
+    fileName: res.fileName,
+    path: res.fileUrl,
+    url: res.fileUrl,
+    uid: file.uid,
+  });
+};
+
+const handleClickFile = (row) => {
+  ElMessage({
+    message: "数据请求中,请稍后!",
+    type: "success",
+  });
+  let id = row.id;
+  proxy.post("/fileInfo/getList", { businessIdList: [id] }).then((res) => {
+    const file = res[id][0];
+    window.open(file.fileUrl, "_blank");
+  });
+};
+
+const handleClose = (index) => {
+  if (fileListCopy.value.length === 1) {
+    return ElMessage({
+      message: "最后一个附件啦!",
+      type: "info",
+    });
+  }
+  fileList.value.splice(index, 1);
+  fileListCopy.value.splice(index, 1);
+};
+
+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;
+    }
+  });
+};
+const handleSelect = (row) => {
+  const flag = formData.data.stockWaitDetailsList.some((x) => x.id === row.id);
+  if (flag)
+    return ElMessage({
+      message: "该物品已选择",
+      type: "info",
+    });
+  formData.data.stockWaitDetailsList.push({
+    name: row.name,
+    code: row.code,
+    id: row.id,
+  });
+  return ElMessage({
+    message: "选择成功",
+    type: "success",
+  });
+};
+
+const handleRemove = (index) => {
+  formData.data.stockWaitDetailsList.splice(index, 1);
+  return ElMessage({
+    message: "删除成功",
+    type: "success",
+  });
+};
+
+getCityData("0");
+getList();
+</script>
+  
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+</style>

+ 373 - 0
src/views/WDLY/stockManage/productCombination/index.vue

@@ -0,0 +1,373 @@
+<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 #slotName="{ item }">
+          {{ item.createTime }}
+        </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 #products>
+          <div style="width: 100%">
+            <el-button
+              type="primary"
+              @click="openProduct = true"
+              style="margin-bottom: 10px"
+            >
+              添加产品
+            </el-button>
+            <el-table :data="formData.data.stockWaitDetailsList">
+              <el-table-column prop="name" label="产品名称" />
+              <el-table-column prop="name" label="可组合数量" />
+              <el-table-column prop="quantity" label="本次组合" min-width="150">
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="'stockWaitDetailsList.' + $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">
+                <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>
+  </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";
+
+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 roomDialogVisible = ref(false);
+let modalType = ref("add");
+let rules = ref({
+  code: [{ required: true, message: "请输入spu编码", trigger: "blur" }],
+  name: [{ required: true, message: "请输入spu名称", trigger: "blur" }],
+});
+const { proxy } = getCurrentInstance();
+const selectConfig = reactive([]);
+
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "单号",
+        prop: "code",
+      },
+    },
+    {
+      attrs: {
+        label: "调出仓库",
+        prop: "name",
+      },
+    },
+    {
+      attrs: {
+        label: "调出人",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "调出时间",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "接收状态",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "调入仓库",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "接收人",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "接收时间",
+        prop: "remark",
+      },
+    },
+
+    {
+      attrs: {
+        label: "操作",
+        width: "200",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "接收",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row);
+            },
+          },
+          {
+            attrs: {
+              label: "打印",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row);
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+
+let formData = reactive({
+  data: {},
+  treeData: [],
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const treeData = ref([]);
+const formConfig = reactive([
+  {
+    type: "title",
+    title: "仓库信息",
+  },
+  {
+    type: "select",
+    prop: "warehouseId",
+    label: "半成品所在仓库",
+    itemWidth: 33,
+    data: [],
+  },
+  {
+    type: "select",
+    prop: "warehouseId",
+    label: "组合后放置仓库",
+    itemWidth: 33,
+    data: [],
+  },
+
+  {
+    type: "title",
+    title: "组合明细",
+  },
+  {
+    type: "slot",
+    slotName: "products",
+  },
+]);
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/productSpu/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 = {
+    stockWaitDetailsList: [],
+  };
+};
+
+const submitForm = () => {
+  console.log(byform.value);
+  byform.value.handleSubmit((valid) => {
+    submitLoading.value = true;
+    proxy.post("/productSpu/" + 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) => {
+  modalType.value = "edit";
+  proxy.post("/productSpu/detail", { id: row.id }).then((res) => {
+    res.stockWaitDetailsList = res.productInfoList;
+    formData.data = res;
+    dialogVisible.value = true;
+  });
+};
+
+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,
+      }));
+      formConfig[2].data = message.rows.map((x) => ({
+        label: x.name,
+        value: x.id,
+      }));
+    });
+};
+getList();
+warehouseListData();
+
+const handleSelect = (row) => {
+  const flag = formData.data.stockWaitDetailsList.some((x) => x.id === row.id);
+  if (flag)
+    return ElMessage({
+      message: "该物品已选择",
+      type: "info",
+    });
+  formData.data.stockWaitDetailsList.push({
+    name: row.name,
+    code: row.code,
+    id: row.id,
+  });
+  return ElMessage({
+    message: "选择成功",
+    type: "success",
+  });
+};
+
+const handleRemove = (index) => {
+  formData.data.stockWaitDetailsList.splice(index, 1);
+  return ElMessage({
+    message: "删除成功",
+    type: "success",
+  });
+};
+</script>
+  
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+</style>

+ 373 - 0
src/views/WDLY/stockManage/productSplit/index.vue

@@ -0,0 +1,373 @@
+<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 #slotName="{ item }">
+          {{ item.createTime }}
+        </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 #products>
+          <div style="width: 100%">
+            <el-button
+              type="primary"
+              @click="openProduct = true"
+              style="margin-bottom: 10px"
+            >
+              添加产品
+            </el-button>
+            <el-table :data="formData.data.stockWaitDetailsList">
+              <el-table-column prop="name" label="产品名称" />
+              <el-table-column prop="name" label="可拆分数量" />
+              <el-table-column prop="quantity" label="本次拆分" min-width="150">
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="'stockWaitDetailsList.' + $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">
+                <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>
+  </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";
+
+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 roomDialogVisible = ref(false);
+let modalType = ref("add");
+let rules = ref({
+  code: [{ required: true, message: "请输入spu编码", trigger: "blur" }],
+  name: [{ required: true, message: "请输入spu名称", trigger: "blur" }],
+});
+const { proxy } = getCurrentInstance();
+const selectConfig = reactive([]);
+
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "单号",
+        prop: "code",
+      },
+    },
+    {
+      attrs: {
+        label: "调出仓库",
+        prop: "name",
+      },
+    },
+    {
+      attrs: {
+        label: "调出人",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "调出时间",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "接收状态",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "调入仓库",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "接收人",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "接收时间",
+        prop: "remark",
+      },
+    },
+
+    {
+      attrs: {
+        label: "操作",
+        width: "200",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "接收",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row);
+            },
+          },
+          {
+            attrs: {
+              label: "打印",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row);
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+
+let formData = reactive({
+  data: {},
+  treeData: [],
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const treeData = ref([]);
+const formConfig = reactive([
+  {
+    type: "title",
+    title: "仓库信息",
+  },
+  {
+    type: "select",
+    prop: "warehouseId",
+    label: "半成品所在仓库",
+    itemWidth: 33,
+    data: [],
+  },
+  {
+    type: "select",
+    prop: "warehouseId",
+    label: "拆分后放置仓库",
+    itemWidth: 33,
+    data: [],
+  },
+
+  {
+    type: "title",
+    title: "拆分明细",
+  },
+  {
+    type: "slot",
+    slotName: "products",
+  },
+]);
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/productSpu/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 = {
+    stockWaitDetailsList: [],
+  };
+};
+
+const submitForm = () => {
+  console.log(byform.value);
+  byform.value.handleSubmit((valid) => {
+    submitLoading.value = true;
+    proxy.post("/productSpu/" + 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) => {
+  modalType.value = "edit";
+  proxy.post("/productSpu/detail", { id: row.id }).then((res) => {
+    res.stockWaitDetailsList = res.productInfoList;
+    formData.data = res;
+    dialogVisible.value = true;
+  });
+};
+
+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,
+      }));
+      formConfig[2].data = message.rows.map((x) => ({
+        label: x.name,
+        value: x.id,
+      }));
+    });
+};
+getList();
+warehouseListData();
+
+const handleSelect = (row) => {
+  const flag = formData.data.stockWaitDetailsList.some((x) => x.id === row.id);
+  if (flag)
+    return ElMessage({
+      message: "该物品已选择",
+      type: "info",
+    });
+  formData.data.stockWaitDetailsList.push({
+    name: row.name,
+    code: row.code,
+    id: row.id,
+  });
+  return ElMessage({
+    message: "选择成功",
+    type: "success",
+  });
+};
+
+const handleRemove = (index) => {
+  formData.data.stockWaitDetailsList.splice(index, 1);
+  return ElMessage({
+    message: "删除成功",
+    type: "success",
+  });
+};
+</script>
+  
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+</style>

+ 384 - 0
src/views/purchaseSales/stockManage/inventory/index.vue

@@ -0,0 +1,384 @@
+<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 #slotName="{ item }">
+          {{ item.createTime }}
+        </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 #products>
+          <div style="width: 100%">
+            <el-button
+              type="primary"
+              @click="openProduct = true"
+              style="margin-bottom: 10px"
+            >
+              添加物品
+            </el-button>
+            <el-table :data="formData.data.stockWaitDetailsList">
+              <el-table-column prop="name" label="物品编码" />
+              <el-table-column prop="name" label="物品名称" />
+              <el-table-column prop="name" label="规格型号" />
+              <el-table-column prop="name" label="单位" />
+              <el-table-column prop="name" label="库存数量" />
+              <el-table-column prop="quantity" label="盘点数量" min-width="150">
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="'stockWaitDetailsList.' + $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="name" label="盘点结果" />
+              <el-table-column prop="zip" label="操作" width="100">
+                <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
+    >
+      <SelectGoods
+        @cancel="openProduct = false"
+        @pushGoods="pushGoods"
+      ></SelectGoods>
+    </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 SelectGoods from "@/components/product/SelectGoods";
+
+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 roomDialogVisible = ref(false);
+let modalType = ref("add");
+let rules = ref({
+  code: [{ required: true, message: "请输入spu编码", trigger: "blur" }],
+  name: [{ required: true, message: "请输入spu名称", trigger: "blur" }],
+});
+const { proxy } = getCurrentInstance();
+const selectConfig = reactive([
+  {
+    label: "盘点结论",
+    prop: "type",
+    data: [
+      {
+        label: "正常",
+        value: "1",
+      },
+
+      {
+        label: "异常",
+        value: "2",
+      },
+    ],
+  },
+]);
+
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "单号",
+        prop: "code",
+      },
+    },
+    {
+      attrs: {
+        label: "调出仓库",
+        prop: "name",
+      },
+    },
+    {
+      attrs: {
+        label: "调出人",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "调出时间",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "接收状态",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "调入仓库",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "接收人",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "接收时间",
+        prop: "remark",
+      },
+    },
+
+    {
+      attrs: {
+        label: "操作",
+        width: "200",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "接收",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row);
+            },
+          },
+          {
+            attrs: {
+              label: "打印",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row);
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+
+let formData = reactive({
+  data: {},
+  treeData: [],
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const treeData = ref([]);
+const formConfig = reactive([
+  {
+    type: "select",
+    prop: "warehouseId",
+    label: "盘点仓库",
+    itemWidth: 33,
+    isLoad: {
+      url: "/warehouse/page",
+      req: {
+        pageNum: 1,
+        pageSize: 9999,
+      },
+      labelKey: "name",
+      labelVal: "id",
+      method: "post",
+      resUrl: "rows",
+    },
+  },
+  {
+    type: "title",
+    title: "盘点明细",
+  },
+  {
+    type: "slot",
+    slotName: "products",
+    label: "",
+  },
+]);
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/productSpu/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 = {
+    stockWaitDetailsList: [],
+  };
+};
+
+const submitForm = () => {
+  console.log(byform.value);
+  byform.value.handleSubmit((valid) => {
+    submitLoading.value = true;
+    proxy.post("/productSpu/" + 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) => {
+  modalType.value = "edit";
+  proxy.post("/productSpu/detail", { id: row.id }).then((res) => {
+    res.stockWaitDetailsList = res.productInfoList;
+    formData.data = res;
+    dialogVisible.value = true;
+  });
+};
+
+getList();
+
+const handleSelect = (row) => {
+  const flag = formData.data.stockWaitDetailsList.some((x) => x.id === row.id);
+  if (flag)
+    return ElMessage({
+      message: "该物品已选择",
+      type: "info",
+    });
+  formData.data.stockWaitDetailsList.push({
+    name: row.name,
+    code: row.code,
+    id: row.id,
+  });
+  return ElMessage({
+    message: "选择成功",
+    type: "success",
+  });
+};
+
+const pushGoods = (goods) => {
+  const arr = goods.map((x) => ({
+    linkProductId: x.id,
+    linkQuantity: "",
+    name: x.name,
+    code: x.code,
+  }));
+  formData.data.stockWaitDetailsList =
+    formData.data.stockWaitDetailsList.concat(arr);
+  return ElMessage({
+    message: "添加成功!",
+    type: "success",
+  });
+};
+
+const handleRemove = (index) => {
+  formData.data.stockWaitDetailsList.splice(index, 1);
+  return ElMessage({
+    message: "删除成功",
+    type: "success",
+  });
+};
+</script>
+  
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+</style>

+ 452 - 0
src/views/salesMange/saleContract/claim/index.vue

@@ -0,0 +1,452 @@
+<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="[]"
+        @get-list="getList"
+      >
+        <template #slotName="{ item }">
+          {{ item.createTime }}
+        </template>
+      </byTable>
+    </div>
+    <el-dialog
+      title="入库"
+      v-model="dialogVisible"
+      width="800"
+      v-loading="loading"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="byform"
+      >
+        <template #detail>
+          <div style="width: 100%">
+            <el-button type="primary" style="margin-bottom: 10px"
+              >选择合同</el-button
+            >
+            <el-table :data="formData.data.stockWaitDetailsList">
+              <el-table-column prop="productCode" label="合同编码" />
+              <el-table-column prop="quantity" label="关联金额" min-width="150">
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="'stockWaitDetailsList.' + $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">
+                <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>
+  </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";
+
+const loading = ref(false);
+const submitLoading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+    type: 1,
+  },
+});
+let dialogVisible = ref(false);
+let roomDialogVisible = ref(false);
+let modalType = ref("add");
+let rules = ref({
+  type: [
+    { required: true, message: "请选择仓库类型", trigger: ["blur", "change"] },
+  ],
+  warehouseId: [
+    { required: true, message: "请选择仓库名称", trigger: "change" },
+  ],
+  quantity: [{ required: true, message: "请输入入库数量", trigger: "blur" }],
+});
+const { proxy } = getCurrentInstance();
+const selectConfig = reactive([
+  {
+    label: "认领状态",
+    prop: "type",
+    data: [
+      {
+        label: "未认领",
+        value: "1",
+      },
+      {
+        label: "已认领",
+        value: "2",
+      },
+    ],
+  },
+]);
+const inboundType = ref([
+  {
+    label: "未入库",
+    value: "0",
+  },
+  {
+    label: "部分入库",
+    value: "1",
+  },
+  {
+    label: "入库完成",
+    value: "2",
+  },
+]);
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "账户名称",
+        prop: "businessType",
+      },
+      // render(type) {
+      //   return proxy.dictDataEcho(type, warehouseType.value);
+      // },
+    },
+    {
+      attrs: {
+        label: "到账金额",
+        prop: "code",
+      },
+    },
+
+    {
+      attrs: {
+        label: "到账时间",
+        prop: "logisticsCompanyName",
+      },
+    },
+    {
+      attrs: {
+        label: "对方账户名称",
+        prop: "receiptWarehouseName",
+      },
+    },
+    {
+      attrs: {
+        label: "对方开户银行",
+        prop: "operatorName",
+      },
+    },
+    {
+      attrs: {
+        label: "对方账号",
+        prop: "createTime",
+      },
+    },
+    {
+      attrs: {
+        label: "摘要",
+        prop: "createTime",
+      },
+    },
+    {
+      attrs: {
+        label: "认领状态",
+        prop: "status",
+      },
+      render(status) {
+        return status == 0 ? "未入库" : status == 1 ? "部分入库" : "";
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "100",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          !row.isForbid
+            ? {
+                attrs: {
+                  label: "认领",
+                  type: "primary",
+                  text: true,
+                  bg: true,
+                  disabled: false,
+                },
+                el: "button",
+                click() {
+                  getDtl(row);
+                },
+              }
+            : {
+                attrs: {
+                  label: "取消认领",
+                  text: true,
+                  bg: true,
+                  type: "primary",
+                  disabled: false,
+                  style: {
+                    color: "#e6a23c",
+                  },
+                },
+                el: "button",
+                click() {
+                  ElMessageBox.confirm("是否确定取消认领?", "提示", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning",
+                  }).then(() => {
+                    // 删除
+                    proxy
+                      .post("/productInfo/delete", {
+                        id: row.id,
+                      })
+                      .then((res) => {
+                        ElMessage({
+                          message: "操作成功",
+                          type: "success",
+                        });
+                        getList();
+                      });
+                  });
+                },
+              },
+        ];
+      },
+    },
+  ];
+});
+
+let formData = reactive({
+  data: {},
+  treeData: [],
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const treeData = ref([]);
+const formConfig = reactive([
+  {
+    type: "title",
+    title: "账户信息",
+  },
+  {
+    type: "select",
+    prop: "businessType",
+    label: "选择账户",
+    required: true,
+    disabled: true,
+  },
+  {
+    type: "title",
+    title: "交易信息",
+  },
+  {
+    type: "date",
+    itemType: "datetime",
+    prop: "businessType",
+    label: "交易时间",
+    disabled: true,
+  },
+  {
+    type: "select",
+    // itemType: "datetime",
+    prop: "businessType",
+    label: "交易金额",
+    itemWidth: 20,
+    disabled: true,
+  },
+  {
+    type: "selectInput",
+    // itemType: "datetime",
+    prop: "businessType",
+    label: " ",
+    itemWidth: 80,
+    disabled: true,
+  },
+
+  // {
+  //   type: "select",
+  //   prop: "warehouseId",
+  //   label: "仓库名称",
+  //   itemWidth: 33,
+  //   isLoad: {
+  //     url: "/warehouse/page",
+  //     req: {
+  //       pageNum: 1,
+  //       pageSize: 9999,
+  //     },
+  //     labelKey: "name",
+  //     labelVal: "id",
+  //     method: "post",
+  //     resUrl: "rows",
+  //   },
+  // },
+  {
+    type: "title",
+    title: "认领信息",
+  },
+  {
+    type: "slot",
+    slotName: "detail",
+    label: "",
+  },
+]);
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/stockWait/pageByWdly", sourceList.value.pagination)
+    .then((message) => {
+      console.log(message);
+      sourceList.value.data = message.rows.map((x) => ({
+        ...x,
+        ...JSON.parse(x.victoriatouristJson),
+      }));
+      sourceList.value.pagination.total = message.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
+};
+const openModal = () => {
+  dialogVisible.value = true;
+  modalType.value = "add";
+  formData.data = {};
+};
+
+const submitForm = () => {
+  byform.value.handleSubmit((valid) => {
+    const list = formData.data.stockWaitDetailsList;
+    const total = list.reduce((total, x) => (total += Number(x.quantity)), 0);
+    if (!(total > 0)) {
+      return ElMessage({
+        message: `本次入库不能为0!`,
+        type: "info",
+      });
+    }
+    for (let i = 0; i < list.length; i++) {
+      const e = list[i];
+      if (Number(e.receiptQuantity) + e.quantity > Number(e.purchaseQuantity)) {
+        return ElMessage({
+          message: "本次入库加已入库数量不可大于到货数量!",
+          type: "info",
+        });
+      }
+    }
+    submitLoading.value = true;
+    proxy.post("/stockWait/addByWdly", formData.data).then(
+      (res) => {
+        ElMessage({
+          message: "操作成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      (err) => (submitLoading.value = false)
+    );
+  });
+};
+
+const getDtl = (row) => {
+  modalType.value = "edit";
+  dialogVisible.value = true;
+
+  // proxy.post("/stockWait/detailByWdly", { id: row.id }).then((res) => {
+  //   const json = JSON.parse(res.victoriatouristJson);
+  //   formData.data = {
+  //     type: "1",
+  //     businessType: res.businessType,
+  //     warehouseId: "",
+  //     code: json.code,
+  //     stockWaitDetailsList: res.stockWaitDetailsList.map((x) => ({
+  //       ...x,
+  //       arrivalQuantity: x.quantity,
+  //       quantity: 0,
+  //     })),
+  //   };
+  //   dialogVisible.value = true;
+  // });
+};
+
+const warehouseType = ref([]);
+const getDict = () => {
+  // // 币种数据
+  proxy
+    .post("/dictTenantData/page", {
+      pageNum: 1,
+      pageSize: 999,
+      tenantId: useUserStore().user.tenantId,
+      dictCode: "warehouse_type",
+    })
+    .then((res) => {
+      warehouseType.value = res.rows;
+      formConfig[0].data = res.rows.map((x) => ({
+        label: x.dictValue,
+        value: x.dictKey,
+      }));
+    });
+};
+getList();
+getDict();
+onMounted(() => {});
+</script>
+  
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+</style>