소스 검색

Merge branch 'master' of http://36.137.93.232:3000/hf/byte-sailing-new

lxf 2 년 전
부모
커밋
6c2921f838

+ 0 - 0
src/components/WDLY/order/details.vue


+ 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>

+ 13 - 2
src/components/byForm/index.vue

@@ -35,6 +35,7 @@
           :max="i.max"
           :min="i.min"
           :maxlength="i.maxlength"
+          :readonly="i.readonly ? i.readonly : false"
         />
         <el-input
           v-if="i.type == 'selectInput'"
@@ -46,6 +47,7 @@
           :max="i.max"
           :min="i.min"
           :maxlength="i.maxlength"
+          :readonly="i.readonly ? i.readonly : false"
         >
           <template #prepend>
             <el-select
@@ -53,6 +55,7 @@
               :placeholder="i.selectPlaceholder || '请选择'"
               @change="(e) => commonsEmit(e, i)"
               :disabled="i.disabled ? i.disabled : false"
+              :readonly="i.readonly ? i.readonly : false"
               style="width:80px"
               
             >
@@ -75,6 +78,7 @@
           :disabled="i.disabled ? i.disabled : false"
           :filterable="i.filterable ? true : false"
           :style="i.style"
+          :readonly="i.readonly ? i.readonly : false"
         >
           <el-option
             :label="j.title || j.name || j.label"
@@ -88,6 +92,7 @@
           v-model="formData[i.prop]"
           v-else-if="i.type == 'treeSelect'"
           :data="i.data"
+          :readonly="i.readonly ? i.readonly : false"
           :props="{
             value: i.propsTreeValue || 'id',
             label: i.propsTreeLabel || 'label',
@@ -99,6 +104,7 @@
         />
         <el-date-picker
           v-model="formData[i.prop]"
+          :readonly="i.readonly ? i.readonly : false"
           v-else-if="i.type == 'date'"
           :type="i.itemType"
           :placeholder="i.placeholder || '请选择时间'"
@@ -110,11 +116,13 @@
         <el-switch
           :disabled="i.disabled ? i.disabled : false"
           v-else-if="i.type == 'switch'"
+          :readonly="i.readonly ? i.readonly : false"
           v-model="formData[i.prop]"
         />
         <el-checkbox-group
           v-else-if="i.type == 'checkbox'"
           v-model="formData[i.prop]"
+          :readonly="i.readonly ? i.readonly : false"
           :disabled="i.disabled ? i.disabled : false"
         >
           <el-checkbox
@@ -129,6 +137,7 @@
         <el-radio-group
           v-else-if="i.type == 'radio'"
           v-model="formData[i.prop]"
+          :readonly="i.readonly ? i.readonly : false"
           :disabled="i.disabled ? i.disabled : false"
         >
           <el-radio
@@ -144,6 +153,7 @@
         <el-input-number
           v-else-if="i.type == 'number'"
           v-model="formData[i.prop]"
+          :readonly="i.readonly ? i.readonly : false"
           :placeholder="i.placeholder || '请输入'"
           @input="commonsEmit"
           :disabled="i.disabled ? i.disabled : false"
@@ -159,6 +169,7 @@
           v-else-if="i.type == 'tree'"
           :data="i.data"
           :props="i.props"
+          :readonly="i.readonly ? i.readonly : false"
           :show-checkbox="i.showCheckbox || true"
         >
         </el-tree>
@@ -166,6 +177,7 @@
           v-else-if="i.type == 'cascader'"
           :options="i.data"
           :props="i.props"
+          :readonly="i.readonly ? i.readonly : false"
           :placeholder="i.placeholder || '请选择'"
           @change="commonsEmit"
           :disabled="i.disabled ? i.disabled : false"
@@ -184,6 +196,7 @@
             :formOption="formOption"
             v-model="formData[i.prop]"
             ref="byform"
+            :rules="rules"
           >
           </byForm>
         </div>
@@ -255,14 +268,12 @@ const dateFormatInit = (itemType) => {
     datetimerange: "YYYY-MM-DD hh:mm:ss",
     daterange: "YYYY-MM-DD hh:mm:ss",
   };
-  console.log(formatObj);
   return formatObj[itemType];
 };
 
 //公用递归,保证key,val统一
 const commonRecursive = (arr, labelKey, labelVal, childrenName) => {
   for (let i = 0; i < arr.length; i++) {
-    console.log(arr[i]);
     if (labelKey == "stringArray") {
       arr[i] = {
         label: arr[i],

+ 3 - 3
src/layout/components/AppMain.vue

@@ -21,10 +21,10 @@ const tagsViewStore = useTagsViewStore()
 <style lang="scss" scoped>
 .app-main {
   /* 50= navbar  50  */
-  min-height: calc(100vh - 50px);
+  height: calc(100vh - 100px);
   width: 100%;
   position: relative;
-  overflow: hidden;
+  overflow-y: auto;
 }
 
 .fixed-header + .app-main {
@@ -34,7 +34,7 @@ const tagsViewStore = useTagsViewStore()
 .hasTagsView {
   .app-main {
     /* 84 = navbar + tags-view = 50 + 34 */
-    min-height: calc(100vh - 100px);
+    height: calc(100vh - 100px);
   }
 
   .fixed-header + .app-main {

+ 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);

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

@@ -0,0 +1,552 @@
+<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.businessCode }}
+          </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({
+  businessType: [
+    { required: true, message: "请选择数据来源", trigger: "change" },
+  ],
+  logisticsCompanyCode: [
+    { required: true, message: "请选择物流/快递公司", trigger: "change" },
+  ],
+  code: [{ required: true, message: "请输入物流/快递单号", trigger: "blur" }],
+  isKd100: [{ required: true, message: "请选择是否同步", trigger: "change" }],
+});
+const { proxy } = getCurrentInstance();
+const selectConfig = reactive([
+  {
+    label: "数据来源",
+    prop: "businessType",
+    data: [],
+  },
+  {
+    label: "物流状态",
+    prop: "logisticsStatus",
+    data: [],
+  },
+  {
+    label: "完成状态",
+    prop: "status",
+    data: [
+      {
+        label: "待接收",
+        value: "1",
+      },
+      {
+        label: "部分接收",
+        value: "2",
+      },
+      {
+        label: "已接收",
+        value: "2",
+      },
+    ],
+  },
+]);
+
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "数据来源",
+        prop: "businessType",
+      },
+      render(type) {
+        return proxy.dictDataEcho(type, businessType.value);
+      },
+    },
+    {
+      attrs: {
+        label: "关联单号",
+        prop: "businessCode",
+        slot: "one",
+      },
+    },
+    {
+      attrs: {
+        label: "物流/快递公司",
+        prop: "logisticsCompanyCode",
+      },
+    },
+    {
+      attrs: {
+        label: "物流/快递单号",
+        prop: "code",
+        slot: "two",
+      },
+    },
+    {
+      attrs: {
+        label: "物流状态",
+        prop: "logisticsStatus",
+      },
+    },
+    {
+      attrs: {
+        label: "创建时间",
+        prop: "createTime",
+      },
+    },
+
+    {
+      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: "businessType",
+    label: "数据来源",
+    data: [],
+    itemWidth: 61,
+  },
+  {
+    type: "select",
+    prop: "logisticsCompanyCode",
+    label: "物流/快递信息",
+    data: [],
+    itemWidth: 40,
+    style: {
+      width: "100%",
+    },
+  },
+  {
+    type: "input",
+    prop: "code",
+    label: " ",
+    itemWidth: 60,
+  },
+  {
+    type: "radio",
+    prop: "isKd100",
+    label: "是否同步",
+    required: true,
+    border: true,
+    data: [
+      { label: "是", value: "1" },
+      { label: "否", value: "2" },
+    ],
+  },
+  {
+    type: "input",
+    prop: "remark",
+    label: "备注",
+    itemType: "textarea",
+  },
+]);
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/logisticsInfos/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 = {
+    isKd100: "1",
+  };
+};
+
+const submitForm = () => {
+  console.log(byform.value);
+  byform.value.handleSubmit((valid) => {
+    submitLoading.value = true;
+    proxy.post("/logisticsInfos/" + 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("/logisticsInfos/getLogistics", { id }).then((res) => {
+    console.log(res, "wss");
+  });
+  openRecord.value = true;
+};
+
+const businessType = ref([
+  {
+    dictValue: "采购入库",
+    dictKey: "1",
+  },
+  {
+    dictValue: "京东订单出库",
+    dictKey: "2",
+  },
+  {
+    dictValue: "销售订单出库",
+    dictKey: "3",
+  },
+  {
+    dictValue: "京东退货",
+    dictKey: "4",
+  },
+]);
+
+onMounted(() => {
+  selectConfig[0].data = businessType.value.map((x) => ({
+    label: x.dictValue,
+    value: x.dictKey,
+  }));
+  formConfig[0].data = businessType.value.map((x) => ({
+    label: x.dictValue,
+    value: x.dictKey,
+  }));
+});
+</script>
+  
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+</style>

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

@@ -0,0 +1,540 @@
+<template>
+  <div class="tenant">
+    <!-- <Banner /> -->
+    <div class="content">
+      <byTable
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        highlight-current-row
+        :selectConfig="selectConfig"
+        :table-events="{
+          //element talbe事件都能传
+          select: select,
+        }"
+        :action-list="[
+          {
+            text: '新增调仓',
+            action: () => openModal('add'),
+          },
+        ]"
+        @get-list="getList"
+      >
+        <template #code="{ item }">
+          <div
+            style="cursor: pointer; color: #409eff"
+            @click="getDtl(item, 'detail')"
+          >
+            {{ item.code }}
+          </div>
+        </template>
+      </byTable>
+    </div>
+    <el-dialog
+      :title="
+        modalType == 'add'
+          ? '新增调仓'
+          : modalType == 'edit'
+          ? '调仓接收'
+          : '调仓详情'
+      "
+      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"
+              v-if="modalType == 'add'"
+            >
+              添加物品
+            </el-button>
+            <el-table :data="formData.data.stockTransferDetailsList">
+              <el-table-column prop="productCode" label="物品编码" />
+              <el-table-column prop="productName" label="物品名称" />
+              <el-table-column prop="productSpec" label="规格型号" />
+              <el-table-column
+                prop="outQuantity"
+                label="调仓数量"
+                v-if="modalType == 'detail'"
+              />
+              <el-table-column
+                prop="inQuantity"
+                label="接收数量"
+                v-if="modalType == 'detail'"
+              />
+
+              <el-table-column
+                prop="outQuantity"
+                label="调仓数量"
+                v-if="modalType == 'edit'"
+              />
+              <el-table-column
+                prop="outQuantity"
+                label="调仓数量"
+                min-width="150"
+                v-if="modalType == 'add'"
+              >
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="
+                      'stockTransferDetailsList.' + $index + '.outQuantity'
+                    "
+                    :rules="rules.outQuantity"
+                    :inline-message="true"
+                  >
+                    <el-input-number
+                      v-model="row.outQuantity"
+                      :precision="2"
+                      :controls="false"
+                      :min="0"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="inQuantity"
+                label="接收数量"
+                min-width="150"
+                v-if="modalType == 'edit'"
+              >
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="'stockTransferDetailsList.' + $index + '.inQuantity'"
+                    :rules="rules.inQuantity"
+                    :inline-message="true"
+                  >
+                    <el-input-number
+                      v-model="row.inQuantity"
+                      :precision="2"
+                      :controls="false"
+                      :min="0"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+
+              <el-table-column
+                prop="zip"
+                label="操作"
+                width="100"
+                v-if="modalType == 'add'"
+              >
+                <template #default="{ $index }">
+                  <el-button type="primary" link @click="handleRemove($index)"
+                    >删除</el-button
+                  >
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </template>
+      </byForm>
+      <template #footer v-if="modalType != 'detail'">
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="submitForm('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, watch } 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,
+    outWarehouseId: "",
+    inWarehouseId: "",
+    inStatus: "",
+  },
+});
+let dialogVisible = ref(false);
+let openProduct = ref(false);
+let roomDialogVisible = ref(false);
+let modalType = ref("add");
+let rules = ref({
+  outWarehouseId: [
+    { required: true, message: "请选择调出仓库", trigger: "change" },
+  ],
+  inWarehouseId: [
+    { required: true, message: "请选择调入仓库", trigger: "change" },
+  ],
+  outQuantity: [{ required: true, message: "请输入调仓数量", trigger: "blur" }],
+  inQuantity: [{ required: true, message: "请输入接收数量", trigger: "blur" }],
+});
+const { proxy } = getCurrentInstance();
+const selectConfig = reactive([
+  {
+    label: "调出仓库",
+    prop: "outWarehouseId",
+    data: [],
+  },
+  {
+    label: "调入仓库",
+    prop: "inWarehouseId",
+    data: [],
+  },
+  {
+    label: "接收状态",
+    prop: "inStatus",
+    data: [
+      {
+        label: "待接收",
+        value: "0",
+      },
+      {
+        label: "部分接收",
+        value: "1",
+      },
+
+      {
+        label: "已接收",
+        value: "2",
+      },
+    ],
+  },
+]);
+
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        slot: "code",
+        label: "单号",
+      },
+    },
+    {
+      attrs: {
+        label: "调出仓库",
+        prop: "outWarehouseName",
+      },
+    },
+    {
+      attrs: {
+        label: "调出人",
+        prop: "outUserName",
+      },
+    },
+    {
+      attrs: {
+        label: "调出时间",
+        prop: "createTime",
+      },
+    },
+    {
+      attrs: {
+        label: "接收状态",
+        prop: "inStatus",
+      },
+      render(inStatus) {
+        return inStatus == 0 ? "待接收" : inStatus == 1 ? "部分接收" : "已接收";
+      },
+    },
+    {
+      attrs: {
+        label: "调入仓库",
+        prop: "inWarehouseName",
+      },
+    },
+    {
+      attrs: {
+        label: "接收人",
+        prop: "inUserName",
+      },
+    },
+    {
+      attrs: {
+        label: "接收时间",
+        prop: "inTime",
+      },
+    },
+
+    {
+      attrs: {
+        label: "操作",
+        width: "200",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "接收",
+              type: "primary",
+              text: true,
+              disabled: row.inStatus > 1,
+            },
+            el: "button",
+            click() {
+              getDtl(row, "edit");
+            },
+          },
+          {
+            attrs: {
+              label: "打印",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              // getDtl(row);
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+
+let formData = reactive({
+  data: {},
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const formConfig = reactive([
+  {
+    type: "title",
+    title: "调仓信息",
+  },
+  {
+    type: "select",
+    prop: "outWarehouseId",
+    label: "调出仓库",
+    itemWidth: 33,
+    disabled: false,
+    data: [],
+  },
+  {
+    type: "select",
+    prop: "inWarehouseId",
+    label: "调入仓库",
+    itemWidth: 33,
+    disabled: false,
+    data: [],
+  },
+  {
+    type: "input",
+    prop: "remark",
+    label: "调拨说明",
+    itemType: "textarea",
+    disabled: false,
+  },
+  {
+    type: "title",
+    title: "调仓明细",
+  },
+  {
+    type: "slot",
+    slotName: "products",
+  },
+]);
+
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/stockTransfer/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 = {
+    stockTransferDetailsList: [],
+  };
+};
+
+const submitForm = () => {
+  byform.value.handleSubmit((valid) => {
+    if (modalType.value == "add") {
+      if (formData.data.outWarehouseId === formData.data.inWarehouseId)
+        return ElMessage({
+          message: "调出仓库和调入仓库不可一致!",
+          type: "info",
+        });
+
+      if (!formData.data.stockTransferDetailsList.length > 0)
+        return ElMessage({
+          message: "请添加调仓明细",
+          type: "info",
+        });
+    } else {
+      const list = formData.data.stockTransferDetailsList;
+      for (let i = 0; i < list.length; i++) {
+        const e = list[i];
+        if (Number(e.inQuantity) > Number(e.outQuantity)) {
+          return ElMessage({
+            message: `接收数量不可大于调出数量!`,
+            type: "info",
+          });
+        }
+      }
+    }
+    const requestUrl =
+      modalType.value == "add"
+        ? "/stockTransfer/add"
+        : "/stockTransfer/receive";
+    submitLoading.value = true;
+    const data = {
+      id: formData.data.id,
+      stockTransferDetailsList: formData.data.stockTransferDetailsList,
+    };
+    proxy
+      .post(requestUrl, modalType.value == "add" ? formData.data : data)
+      .then(
+        (res) => {
+          ElMessage({
+            message: modalType.value == "add" ? "添加成功" : "接收成功",
+            type: "success",
+          });
+          dialogVisible.value = false;
+          submitLoading.value = false;
+          getList();
+        },
+        (err) => (submitLoading.value = false)
+      );
+  });
+};
+
+const getDtl = (row, type) => {
+  modalType.value = type;
+  proxy.post("/stockTransfer/detail", { id: row.id }).then((res) => {
+    if (type == "edit") {
+      res.stockTransferDetailsList.forEach(
+        (x) => (x.inQuantity = x.outQuantity)
+      );
+    }
+    formData.data = res;
+    dialogVisible.value = true;
+  });
+};
+
+watch(modalType, () => {
+  formConfig[1].disabled = modalType.value != "add" ? true : false;
+  formConfig[2].disabled = modalType.value != "add" ? true : false;
+  formConfig[3].disabled = modalType.value != "add" ? true : false;
+});
+
+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.stockTransferDetailsList.some(
+    (x) => x.productId === row.id
+  );
+  if (flag)
+    return ElMessage({
+      message: "该物品已选择",
+      type: "info",
+    });
+  formData.data.stockTransferDetailsList.push({
+    productSpec: row.spec,
+    productName: row.name,
+    productCode: row.code,
+    productId: row.id,
+  });
+  return ElMessage({
+    message: "选择成功",
+    type: "success",
+  });
+};
+
+const handleRemove = (index) => {
+  formData.data.stockTransferDetailsList.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>

+ 686 - 0
src/views/WDLY/salesMange/order/index.vue

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

+ 101 - 78
src/views/finance/fundManage/accountPayment/index.vue

@@ -12,18 +12,7 @@
 					//element talbe事件都能传
 					select: select,
 				}"
-				:action-list="[
-					{
-						text: 'Excel导入',
-						action: () => openExcel(),
-						disabled: false,
-					},
-					{
-						text: '添加物料',
-						action: () => openModal('add'),
-						disabled: false,
-					},
-				]"
+				:action-list="[]"
 				@get-list="getList"
 			>
 				<template #pic="{ item }">
@@ -109,7 +98,7 @@
 import { ElMessage, ElMessageBox } from 'element-plus'
 import byTable from '@/components/byTable/index'
 import byForm from '@/components/byForm/index'
-
+import Cookies from 'js-cookie'
 import { computed, defineComponent, ref } from 'vue'
 const loading = ref(false)
 const submitLoading = ref(false)
@@ -165,9 +154,9 @@ const config = computed(() => {
 			attrs: {
 				label: '付款类型',
 				prop: 'type',
-                render(type) {
-                    return proxy.dictDataEcho(type, fundsType.value);
-                },
+				render(type) {
+					return proxy.dictDataEcho(type, dictsData.value.payment_type)
+				},
 			},
 		},
 		{
@@ -279,77 +268,105 @@ const treeListData = ref([])
 const formConfig = computed(() => {
 	return [
 		{
-			type: 'treeSelect',
-			prop: 'productClassifyId',
-			label: '物料分类',
-			data: [],
+			type: 'title',
+			label: '请款信息',
 		},
 		{
-			type: 'select',
-			prop: 'type',
-			label: '物料类型',
-			required: true,
-			data: [
-				{
-					label: '原料',
-					id: '1',
-				},
-				{
-					label: '辅料',
-					id: '2',
-				},
-				{
-					label: '配件',
-					id: '3',
-				},
-				{
-					label: '包材',
-					id: '4',
-				},
-				{
-					label: '其他',
-					id: '5',
-				},
-			],
+			type: 'input',
+			prop: 'businessManagementName',
+			label: '付款账户',
+			readonly: true,
+		},
+		{
+			type: 'input',
+			prop: 'incomeAmount',
+			label: '请款金额',
+			readonly: true,
+		},
+		{
+			type: 'input',
+			prop: 'paymentMethod',
+			label: '付款方式',
+			readonly: true,
 		},
 		{
 			type: 'input',
 			prop: 'name',
-			label: '物料名称',
+			label: '户名',
+			readonly: true,
 		},
 		{
 			type: 'input',
-			prop: 'spec',
-			label: '规格型号',
+			prop: 'accountOpening',
+			label: '银行账号',
+			readonly: true,
 		},
 		{
+			type: 'input',
+			prop: 'openingBank',
+			label: '开户银行',
+			readonly: true,
+		},
+		{
+			type: 'input',
+			prop: 'interbankNumber',
+			label: '联行号',
+			readonly: true,
+		},
+		{
+			type: 'input',
+			prop: 'remark',
+			label: '摘要',
+			readonly: true,
+		},
+		{
+			type: 'title',
+			label: '付款信息',
+		},
+
+		{
 			type: 'select',
-			prop: 'unit',
-			label: '单位',
+			prop: 'accountManagementId',
+			label: '付款账户',
 			required: true,
-			data: [
-				{
-					label: '个',
-					id: '个',
-				},
-				{
-					label: '双',
-					id: '双',
+			isLoad: {
+				url: '/accountManagement/page',
+				req: {
+					pageNum: 1,
+					pageSize: 9999,
 				},
-			],
+				labelKey: 'name',
+				labelVal: 'id',
+				method: 'post',
+				resUrl: 'rows',
+			},
 		},
 		{
-			type: 'slot',
-			slotName: 'productPic',
-			prop: 'fileList',
-			label: '产品图片',
+			type: 'selectInput',
+			label: '付款金额',
+			itemWidth: 60,
+			prop: 'amount',
+			data: [],
+			placeholder: '请输入',
+			selectPlaceholder: '币种',
+			selectProp: 'businessCurrency',
+			
+		},
+		{
+			type: 'date',
+			prop: 'expensesTime',
+			label: '打款时间',
 		},
-
 		{
 			type: 'input',
 			prop: 'remark',
-			label: '备注',
-			itemType: 'textarea',
+			label: '摘要',
+		},
+		{
+			type: 'slot',
+			slotName: 'productPic',
+			prop: 'fileList',
+			label: '上传附件',
 		},
 	]
 })
@@ -366,7 +383,6 @@ const generatePassword = () => {
 	}
 	return password
 }
-
 const getList = async (req) => {
 	sourceList.value.pagination = { ...sourceList.value.pagination, ...req }
 	loading.value = true
@@ -384,9 +400,20 @@ const getList = async (req) => {
 const uploadData = ref({})
 const fileList = ref([])
 const fileListCopy = ref([])
-proxy.getDict(['payment_status','funds_type','funds_payment_method']).then((res) => {
-	console.log(res)
-})
+let dictsData = reactive({})
+proxy
+	.getDict(['payment_status', 'payment_type','account_currency'])
+	.then((res) => {
+		dictsData = res
+		console.log(res)
+		formConfig.value[11].data = res.account_currency.map(item => {
+			return {
+				label: item.dictValue,
+				value: item.dictKey,
+			}
+		})
+		console.log(formConfig.value[11].data)	
+	})
 const openModal = () => {
 	dialogVisible.value = true
 	modalType.value = 'add'
@@ -416,15 +443,12 @@ const select = (_selection, row) => {
 const submitForm = () => {
 	console.log(byform.value)
 	byform.value.handleSubmit((valid) => {
-		formData.data.fileList = fileListCopy.value.map((x) => ({
-			id: x.id,
-			fileName: x.fileName,
-		}))
+		
 		submitLoading.value = true
-		proxy.post('/productInfo/' + modalType.value, formData.data).then(
+		proxy.post('/accountPayment/add', formData.data).then(
 			(res) => {
 				ElMessage({
-					message: modalType.value == 'add' ? '添加成功' : '编辑成功',
+					message: '打款成功',
 					type: 'success',
 				})
 				dialogVisible.value = false
@@ -454,7 +478,6 @@ const getTreeList = () => {
 const getDtl = (row) => {
 	modalType.value = 'edit'
 	proxy.post('/accountPayment/detail', { id: row.id }).then((res) => {
-		
 		formData.data = res
 		dialogVisible.value = true
 	})

+ 200 - 113
src/views/finance/fundManage/depExpenses/index.vue

@@ -10,32 +10,21 @@
         highlight-current-row
         :selectConfig="selectConfig"
         :table-events="{
-          //element talbe事件都能传
           select: select,
         }"
         :action-list="[]"
         @get-list="getList"
       >
-        <template #phoneNumber="{ item }">
-          <div>
-            <span v-for="(x, index) in getTypeData(item, 0)">
-              {{ x.contactNumber }}
-              <span v-if="index < getTypeData(item, 0).length - 1">,</span>
-            </span>
-          </div>
-        </template>
-        <template #email="{ item }">
-          <div>
-            <span v-for="(x, index) in getTypeData(item, 1)">
-              {{ x.contactNumber }}
-              <span v-if="index < getTypeData(item, 1).length - 1">,</span>
-            </span>
+        <template #amount="{ item }">
+          <div :style="`color: ${item.amount <= 0 ? 'red' : '#39C55A'}`">
+            {{dictDataEcho(item.currency,dictsData.account_currency) + ' ' + item.amount}}
           </div>
         </template>
+        
       </byTable>
     </div>
     <el-dialog
-      :title="modalType == 'add' ? '添加IoT平台' : '编辑'"
+      title="拆分"
       v-model="dialogVisible"
       width="600"
       v-loading="loading"
@@ -57,60 +46,63 @@
               label-width="0px"
               style="margin-top: 15px"
             >
-              <el-table :data="formData.data.internalAddressBookList">
-                <el-table-column prop="type" label="部门">
+              <el-table :data="formData.data.accountDeptRunningWaterDetailList">
+                <el-table-column prop="deptId" label="部门">
                   <template #default="{ row, $index }">
                     <el-form-item
-                      :prop="'internalAddressBookList.' + $index + '.type123'"
-                      :rules="rules.type"
+                      :prop="'accountDeptRunningWaterDetailList.' + $index + '.deptId'"
+                      :rules="rules.deptId"
                       :inline-message="true"
                     >
-                      <el-select v-model="row.type" placeholder="请选择">
-                        <el-option
-                          v-for="item in contactInformationType"
-                          :label="item.dictValue"
-                          :value="item.dictKey"
-                        >
-                        </el-option>
-                      </el-select>
+                      <el-cascader
+                        v-model="row.deptId"
+                        :options="deptTreeData"
+                        :props="{
+                          value: 'deptId',
+                        }"
+                        clearable
+                        filterable
+                        style="width: 100%"
+                      />
                     </el-form-item>
                   </template>
                 </el-table-column>
                 <el-table-column
-                  prop="contactNumber"
+                  prop="amount"
                   label="分拆金额"
                   
                 >
                   <template #default="{ row, $index }">
                     <el-form-item
                       :prop="
-                        'internalAddressBookList.' + $index + '.type456'
+                        'accountDeptRunningWaterDetailList.' + $index + '.amount'
                       "
-                      :rules="rules.contactNumber"
+                      :rules="rules.amount"
                       :inline-message="true"
                     >
                       <el-input
-                        v-model="row.contactNumber"
+                        v-model="row.amount"
                         placeholder="请输入"
+                        type="number"
                       />
                     </el-form-item>
                   </template>
                 </el-table-column>
                 <el-table-column
-                  prop="contactNumber"
+                  prop="remarks"
                   label="备注"
                   
                 >
                   <template #default="{ row, $index }">
                     <el-form-item
                       :prop="
-                        'internalAddressBookList.' + $index + '.type789'
+                        'accountDeptRunningWaterDetailList.' + $index + '.remarks'
                       "
-                      :rules="rules.contactNumber"
+                      :rules="rules.remarks"
                       :inline-message="true"
                     >
                       <el-input
-                        v-model="row.contactNumber"
+                        v-model="row.remarks"
                         placeholder="请输入"
                       />
                     </el-form-item>
@@ -140,6 +132,35 @@
         </el-button>
       </template>
     </el-dialog>
+    <el-dialog
+      title="调整部门"
+      v-model="depModal"
+      width="600"
+      v-loading="loading"
+    >
+      <p>部门名称</p>
+      <el-cascader
+          v-model="departmentId"
+          :options="deptTreeData"
+          :props="{
+            value: 'deptId',
+          }"
+          clearable
+          filterable
+          style="width: 100%"
+        />
+      <template #footer>
+        <el-button @click="depModal = false" size="large">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="submitDeptForm(departmentId)"
+          size="large"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
   
@@ -170,65 +191,59 @@ let rules = ref({
     { required: true, message: "请输入联系号码", trigger: "blur" },
   ],
 });
+import Cookies from 'js-cookie'
+
 const { proxy } = getCurrentInstance();
 const selectConfig = [];
 const config = computed(() => {
   return [
     {
       attrs: {
-        label: "归属部门",
-      },
-      render(row) {
-        return row.dept.deptName;
-      },
-    },
-    {
-      attrs: {
         label: "资金账户",
-        prop: "deptId",
+        prop: "accountManagementName",
       },
     },
     {
       attrs: {
         label: "交易时间",
-        prop: "nickName",
+        prop: "transactionTime",
       },
     },
     {
       attrs: {
-        type: "slot",
-        slot: "phoneNumber",
         label: "交易金额",
+        prop: "amount",
+        slot:'amount'
       },
     },
     {
       attrs: {
-        slot: "email",
+        prop: "accountOpening",
         label: "对方账户",
       },
     },
     {
       attrs: {
-        slot: "email",
+        prop: "openingBank",
         label: "对方银行",
       },
     },
     {
       attrs: {
-        slot: "email",
+        prop: "name",
         label: "对方账号",
       },
     },
     {
       attrs: {
-        slot: "email",
+        prop: "remarks",
         label: "摘要",
       },
     },
     {
       attrs: {
         label: "操作",
-        width: "100",
+        width: "200",
         align: "right",
       },
       // 渲染 el-button,一般用在最后一列。
@@ -236,7 +251,20 @@ const config = computed(() => {
         return [
           {
             attrs: {
-              label: "分析",
+              label: "调整部门",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              depModal.value = true;
+              runningWaterId = row.id
+              departmentId.value = []
+            },
+          },
+          {
+            attrs: {
+              label: "分拆",
               type: "primary",
               text: true,
             },
@@ -265,27 +293,86 @@ const formOption = reactive({
 });
 const byform = ref(null);
 const treeData = ref([]);
+const depModal = ref(false);
+let deptTreeData = ref([]);
+let departmentId = ref([])
+let runningWaterId = ''
+const getDept = async (row) => {
+  // 部门树
+  proxy
+    .get("/tenantDept/list", {
+      pageNum: 1,
+      pageSize: 9999,
+      tenantId: Cookies.get('tenantId')
+    })
+    .then((message) => {
+      recursive(message.data);
+      deptTreeData.value = proxy.handleTree(message.data, "corporationId");
+    });
+};
+getDept()
+
+const submitDeptForm = async (departmentId) => {
+  
+  if (departmentId.length == 0) {
+    ElMessage.error("请选择部门");
+    return;
+  }
+  const params = {
+    deptId: departmentId[departmentId.length - 1],
+    accountDeptRunningWaterId:  runningWaterId
+  };
+  proxy
+    .post("/accountDeptRunningWaterDetail/add", params)
+    .then((message) => {
+      ElMessage.success("调整部门成功");
+      depModal.value = false;
+      getList();
+    })
+    .catch((error) => {
+      ElMessage.error(error);
+    });
+};
+
+const recursive = (data) => {
+  data.map((item) => {
+    item.label = item.deptName;
+    item.id = item.corporationId;
+    if (item.children) {
+      recursive(item.children);
+    } else {
+      item.children = [];
+    }
+  });
+};
+
 const formConfig = computed(() => {
   return [
     {
-      type: "input",
-      prop: "deptName",
-      label: "选择账户",
+			type: 'select',
+			prop: 'accountManagementId',
+			label: '付款账户',
+			required: true,
       disabled: true,
-    },
+			isLoad: {
+				url: '/accountManagement/page',
+				req: {
+					pageNum: 1,
+					pageSize: 9999,
+				},
+				labelKey: 'name',
+				labelVal: 'id',
+				method: 'post',
+				resUrl: 'rows',
+			},
+		},
     {
       type: "date",
-      prop: "nickName",
+      prop: "transactionTime",
       label: "交易时间",
       disabled: true,
     },
     {
-      type: "select",
-      label: "交易金额",
-      itemWidth: 20,
-      data:[]
-    },
-    {
       type: "selectInput",
       label: "交易金额",
       itemWidth: 60,
@@ -293,24 +380,16 @@ const formConfig = computed(() => {
       placeholder: "请输入",
       selectPlaceholder: "币种",
       selectProp: "currency",
-      isLoad: {
-        url: "/supplierInfo/page",
-        req: {
-          pageNum: 1,
-          pageSize: 9999,
-        },
-        labelKey: "name",
-        labelVal: "id",
-        method: "post",
-        resUrl: "rows",
-      },
+      prop: "amount",
+      disabled: true,
     },
     {
       type: "input",
-      prop: "deptName",
+      prop: "remarks",
       label: "摘要",
       disabled: true,
       itemType: "textarea",
+      disabled: true,
     },
     {
       type:'slot',
@@ -326,6 +405,7 @@ const getList = async (req) => {
   proxy
     .post("/accountDeptRunningWater/page", sourceList.value.pagination)
     .then((message) => {
+      console.log(message)
       sourceList.value.data = message.rows;
       sourceList.value.pagination.total = message.total;
       setTimeout(() => {
@@ -333,21 +413,45 @@ const getList = async (req) => {
       }, 200);
     });
 };
+let dictsData = reactive({})
+proxy
+	.getDict(['payment_status', 'payment_type','account_currency'])
+	.then((res) => {
+		dictsData = res
+		console.log(res)
+		formConfig.value[2].data = res.account_currency.map(item => {
+			return {
+				label: item.dictValue,
+				value: item.dictKey,
+			}
+		})
+	})
+
 
 const openModal = () => {
   dialogVisible.value = true;
   modalType.value = "add";
   formData.data = {};
 };
-openModal()
+
 
 const submitForm = () => {
   byform.value.handleSubmit((valid) => {
     submitLoading.value = true;
-    proxy.post("/internalAddressBook/" + modalType.value, formData.data).then(
+    const params = {
+      id: formData.data.id,
+      deptRunningWaterDetailList: formData.data.accountDeptRunningWaterDetailList,
+      accountDeptRunningWaterId: formData.data.accountDeptRunningWaterId,
+    };
+    params.deptRunningWaterDetailList.map((item) => {
+      item.deptId = item.deptId[item.deptId.length - 1];
+    })
+    proxy.post("/accountDeptRunningWaterDetail/add", {
+      ...params
+    }).then(
       (res) => {
         ElMessage({
-          message: modalType.value == "add" ? "添加成功" : "编辑成功",
+          message: "拆分成功",
           type: "success",
         });
         dialogVisible.value = false;
@@ -361,34 +465,30 @@ const submitForm = () => {
 
 const getDtl = (row) => {
   modalType.value = "edit";
+  dialogVisible.value = true;
   proxy
-    .post("/internalAddressBook/detail", { userId: row.userId })
+    .post("/accountDeptRunningWaterDetail/detail", { id: row.id })
     .then((res) => {
-      res.forEach((x) => {
-        x.type = x.type + "";
+      console.log(res)
+      res.accountDeptRunningWaterDetailList = res.deptRunningWaterDetailList.map((item) => {
+        item.deptId = [item.deptId];
+        return item;
       });
-      formData.data = {
-        deptName: row.dept.deptName,
-        nickName: row.nickName,
-        internalAddressBookList: res,
-        userId: row.userId,
-      };
+      formData.data = res
       dialogVisible.value = true;
     });
 };
 
 const addRow = () => {
-  console.log(formData.data)
-  formData.data.internalAddressBookList = []
-  formData.data.internalAddressBookList.push({
-    type789: "",
-    type456: "",
-    type123: "",
+  formData.data.accountDeptRunningWaterDetailList.push({
+    remarks: "",
+    amount: null,
+    deptId: [],
   });
 };
 
 const handleRemove = (index) => {
-  formData.data.internalAddressBookList.splice(index, 1);
+  formData.data.accountDeptRunningWaterDetailList.splice(index, 1);
   return ElMessage({
     message: "删除成功!",
     type: "success",
@@ -396,27 +496,14 @@ const handleRemove = (index) => {
 };
 
 const contactInformationType = ref([]);
-const getDict = () => {
-  const tenantId = useUserStore().user.tenantId;
-  proxy
-    .post("/dictTenantData/page", {
-      pageNum: 1,
-      pageSize: 999,
-      tenantId: tenantId,
-      dictCode: "contact_information",
-    })
-    .then((res) => {
-      contactInformationType.value = res.rows;
-    });
-};
 
 const getTypeData = (item, type) => {
-  if (item.internalAddressBookList)
-    return item.internalAddressBookList.filter((x) => x.type === type) || [];
+  if (item.accountDeptRunningWaterDetailList)
+    return item.accountDeptRunningWaterDetailList.filter((x) => x.type === type) || [];
 };
 
-//getList();
-getDict();
+getList();
+
 </script>
   
 <style lang="scss" scoped>

+ 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>