Browse Source

扩展模块

cz 2 years ago
parent
commit
3eeb8b49a5

+ 2 - 2
src/components/process/SendPurchase.vue

@@ -7,7 +7,7 @@
       label-position="top"
     >
       <div class="_t">基础信息</div>
-      <el-row>
+      <el-row :gutter="10">
         <el-col :span="6">
           <el-form-item label="采购部门" prop="deptName">
             <el-input v-model="formData.data.deptName" placeholder="请输入">
@@ -30,7 +30,7 @@
           </el-form-item>
         </el-col>
       </el-row>
-      <el-row>
+      <el-row :gutter="10">
         <el-col :span="8">
           <el-form-item label="供应商" prop="supplyId">
             <el-select

+ 1 - 1
src/components/process/SendSubscribe.vue

@@ -7,7 +7,7 @@
       label-position="top"
     >
       <div class="_t">申购信息</div>
-      <el-row>
+      <el-row :gutter="10">
         <el-col :span="6">
           <el-form-item label="申购部门" prop="deptName">
             <el-input v-model="formData.data.deptName" placeholder="请输入">

+ 754 - 0
src/views/WDLY/basic/product/index.vue

@@ -0,0 +1,754 @@
+<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="[
+          {
+            text: 'Excel导入',
+            action: () => openExcel(),
+            disabled: false,
+          },
+          {
+            text: '添加产品',
+            action: () => openModal('add'),
+            disabled: false,
+          },
+        ]"
+        @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-if="formData.data.combination">
+              <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>
+
+            <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="请输入"
+                  />
+                </el-col>
+                <el-col :span="1" style="text-align: center"> : </el-col>
+                <el-col :span="4">
+                  <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="请输入"
+                  />
+                </el-col>
+                <el-col :span="1" style="text-align: center"> : </el-col>
+                <el-col :span="4">
+                  <el-input
+                    v-model="
+                      formData.data.victoriatouristJson.growUpExpectedSales
+                    "
+                    placeholder="预期销量"
+                  />
+                </el-col>
+              </el-row>
+            </el-form-item>
+            <el-form-item label="成熟期">
+              <el-row>
+                <el-col :span="8"> 大于120天: </el-col>
+                <el-col :span="7">
+                  <el-input
+                    v-model="
+                      formData.data.victoriatouristJson.matureExpectedSales
+                    "
+                    placeholder="预期销量"
+                  />
+                </el-col>
+              </el-row>
+            </el-form-item>
+          </el-form>
+        </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",
+        },
+      ],
+    },
+  ];
+});
+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: "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: "danger",
+              text: true,
+            },
+            el: "button",
+            click() {
+              // 弹窗提示是否删除
+              ElMessageBox.confirm(
+                "此操作将永久删除该数据, 是否继续?",
+                "提示",
+                {
+                  confirmButtonText: "确定",
+                  cancelButtonText: "取消",
+                  type: "warning",
+                }
+              ).then(() => {
+                // 删除
+                proxy
+                  .post("/productInfo/delete", {
+                    id: row.id,
+                  })
+                  .then((res) => {
+                    ElMessage({
+                      message: "删除成功",
+                      type: "success",
+                    });
+                    getList();
+                  });
+              });
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+
+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: 33.33,
+        },
+      ],
+    },
+    {
+      type: "slot",
+      slotName: "combination",
+      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: [] }));
+      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: [],
+    victoriatouristJson: {
+      combination: 1,
+      newProductsDay1: "0",
+      newProductsDay: "60",
+      growUpDay1: "61",
+      growUpDay: "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 = () => {
+  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(
+      (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);
+    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",
+  });
+};
+</script>
+  
+<style lang="scss" scoped>
+.user {
+  padding: 20px;
+  display: flex;
+  justify-content: space-between;
+  .tree {
+    width: 300px;
+  }
+  .content {
+    width: calc(100% - 320px);
+  }
+}
+.pic {
+  object-fit: contain;
+  width: 50px;
+  height: 50px;
+  cursor: pointer;
+  vertical-align: middle;
+}
+</style>

+ 138 - 187
src/views/finance/fundManage/funds/index.vue

@@ -139,13 +139,8 @@
 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 useUserStore from "@/store/modules/user";
 
-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({
@@ -157,27 +152,14 @@ const sourceList = ref({
     status: "",
   },
 });
-let dialogVisible = ref(false);
 let modalType = ref("add");
-let fileList = ref([]);
-let rules = ref({
-  name: [{ required: true, message: "请输入供应商名称", trigger: "blur" }],
-});
+
 const { proxy } = getCurrentInstance();
 const selectConfig = reactive([
   {
     label: "类型",
-    prop: "productType",
-    data: [
-      {
-        label: "产品",
-        value: "1",
-      },
-      {
-        label: "物料",
-        value: "2",
-      },
-    ],
+    prop: "type",
+    data: [],
   },
   {
     label: "审批状态",
@@ -188,20 +170,12 @@ const selectConfig = reactive([
         value: "10",
       },
       {
-        label: "待采购",
-        value: "15",
-      },
-      {
-        label: "部分采购",
-        value: "30",
-      },
-      {
-        label: "已采购",
+        label: "驳回",
         value: "20",
       },
       {
-        label: "已作废",
-        value: "99",
+        label: "已通过",
+        value: "30",
       },
     ],
   },
@@ -210,25 +184,9 @@ const selectConfig = reactive([
     prop: "status",
     data: [
       {
-        label: "审批中",
+        label: "未放款",
         value: "10",
       },
-      {
-        label: "待采购",
-        value: "15",
-      },
-      {
-        label: "部分采购",
-        value: "30",
-      },
-      {
-        label: "已采购",
-        value: "20",
-      },
-      {
-        label: "已作废",
-        value: "99",
-      },
     ],
   },
 ]);
@@ -237,61 +195,70 @@ const config = computed(() => {
     {
       attrs: {
         label: "归属公司",
-        prop: "subscribeCode",
+        prop: "corporationName",
       },
     },
     {
       attrs: {
         label: "归属部门",
-        prop: "productType",
+        prop: "deptName",
       },
     },
     {
       attrs: {
         label: "请款类型",
-        prop: "productCategory",
+        prop: "type",
+      },
+      render(type) {
+        return proxy.dictDataEcho(type, fundsType.value);
       },
     },
     {
       attrs: {
         label: "请款人",
-        prop: "productCode",
+        prop: "userName",
       },
     },
     {
       attrs: {
         label: "请款时间",
-        prop: "productName",
+        prop: "paymentTime",
       },
     },
     {
       attrs: {
         label: "请款金额",
-        prop: "productUnit",
+        prop: "total",
       },
     },
     {
       attrs: {
         label: "用款说明",
-        prop: "count",
+        prop: "paymentRemarks",
       },
     },
     {
       attrs: {
         label: "付款方式",
-        prop: "status",
+        prop: "paymentMethod",
+      },
+      render(paymentMethod) {
+        return proxy.dictDataEcho(paymentMethod, fundsPaymentMethod.value);
       },
     },
     {
       attrs: {
         label: "付款账户",
-        prop: "subscribeContent",
+        prop: "accountManagementId",
       },
     },
     {
       attrs: {
         label: "审批状态",
-        prop: "subscribeContent",
+        prop: "status",
+      },
+      render(status) {
+        return proxy.dictDataEcho(status, fundsPaymentMethod.value);
       },
     },
     {
@@ -299,6 +266,9 @@ const config = computed(() => {
         label: "放款状态",
         prop: "subscribeContent",
       },
+      render(subscribeContent) {
+        return proxy.dictDataEcho(subscribeContent, fundsPaymentMethod.value);
+      },
     },
     {
       attrs: {
@@ -306,20 +276,8 @@ const config = computed(() => {
         width: "100",
         align: "right",
       },
-      // 渲染 el-button,一般用在最后一列。
       renderHTML(row) {
         return [
-          // {
-          //   attrs: {
-          //     label: "修改",
-          //     type: "primary",
-          //     text: true,
-          //   },
-          //   el: "button",
-          //   click() {
-          //     getDtl(row);
-          //   },
-          // },
           {
             attrs: {
               label: "作废",
@@ -360,9 +318,7 @@ const config = computed(() => {
 });
 
 let formData = reactive({
-  data: {
-    type: "1",
-  },
+  data: {},
 });
 const formOption = reactive({
   inline: true,
@@ -371,55 +327,12 @@ const formOption = reactive({
   rules: [],
 });
 const byform = ref(null);
-const formConfig = computed(() => {
-  return [
-    {
-      type: "radio",
-      prop: "name",
-      label: "供应商类型",
-      required: true,
-      border: true,
-      data: [
-        { label: "贸易商", value: "1" },
-        { label: "工厂", value: "2" },
-      ],
-    },
-    {
-      type: "input",
-      prop: "name",
-      label: "供应商名称",
-      required: true,
-    },
-    {
-      type: "slot",
-      slotName: "address",
-      label: "地址",
-      required: true,
-    },
-    {
-      type: "slot",
-      slotName: "contact",
-      label: "联系信息",
-      required: true,
-    },
-    {
-      type: "slot",
-      slotName: "fileSlot",
-      label: "上传附件",
-    },
-    {
-      type: "input",
-      label: "备注",
-      prop: "remakes",
-      itemType: "textarea",
-    },
-  ];
-});
+const formConfig = computed(() => {});
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
   proxy
-    .post("/subscribeDetail/page", sourceList.value.pagination)
+    .post("/accountRequestFunds/page", sourceList.value.pagination)
     .then((message) => {
       console.log(message);
       sourceList.value.data = message.rows;
@@ -440,85 +353,123 @@ const openModal = () => {
 };
 
 const submitForm = () => {
-  if (fileList.value.length > 0) {
-    byform.value.handleSubmit((valid) => {
-      formData.data.fileList = fileList.value;
-      submitLoading.value = true;
-      proxy.post("/productionProcesses/" + modalType.value, formData.data).then(
-        (res) => {
-          ElMessage({
-            message: modalType.value == "add" ? "添加成功" : "编辑成功",
-            type: "success",
-          });
-          fileList.value = [];
-          dialogVisible.value = false;
-          submitLoading.value = false;
-          getList();
-        },
-        (err) => {
-          console.log(err, "aswwwww");
-          submitLoading.value = false;
-        }
-      );
-    });
-  } else {
-    return ElMessage({
-      message: "请上传附件!",
-      type: "info",
-    });
-  }
+  byform.value.handleSubmit((valid) => {
+    formData.data.fileList = fileList.value;
+    submitLoading.value = true;
+    proxy.post("/productionProcesses/" + modalType.value, formData.data).then(
+      (res) => {
+        ElMessage({
+          message: modalType.value == "add" ? "添加成功" : "编辑成功",
+          type: "success",
+        });
+        fileList.value = [];
+        dialogVisible.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      (err) => {
+        console.log(err, "aswwwww");
+        submitLoading.value = false;
+      }
+    );
+  });
 };
 
 const getDtl = (row) => {
   modalType.value = "edit";
   proxy.post("/productionProcesses/detail", { id: row.id }).then((res) => {
-    fileList.value = [
-      {
-        id: "",
-        fileName: res.fileName,
-        path: "",
-      },
-    ];
     formData.data = res;
     dialogVisible.value = true;
   });
 };
-const handleBeforeUpload = async (file) => {
-  const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
-  uploadData.value = res.uploadBody;
-  fileList.value = [
-    {
-      id: res.id,
-      fileName: res.fileName,
-      path: res.fileUrl,
-    },
-  ];
-};
-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 userInfo = useUserStore().user;
+const tenantId = "@福建宏星!#¥%……&*()";
+const companyData = ref([]);
+const accountData = ref([]);
+const deptTreeData = ref([]);
+const fundsType = ref([]);
+const fundsCostType = ref([]);
+const fundsPaymentMethod = ref([]);
+const currencyType = ref([]);
 
-const handlePreview = (file) => {
-  console.log(file);
-};
-const handleSuccess = (file) => {
-  console.log(file);
-};
-const handleRemove = (file) => {
-  fileList.value = [];
-};
-const handleClose = (index) => {
-  fileList.value.splice(index, 1);
+const getDictData = () => {
+  // 获取归属公司数据
+  proxy
+    .post("/corporation/page", { pageNum: 1, pageSize: 9999 })
+    .then((res) => {
+      companyData.value = res.rows;
+    });
+  // 账户数据
+  proxy
+    .post("/accountManagement/page", { pageNum: 1, pageSize: 9999 })
+    .then((res) => {
+      accountData.value = res.rows;
+    });
+
+  // 部门树
+  proxy
+    .get("/tenantDept/list", {
+      pageNum: 1,
+      pageSize: 9999,
+      tenantId: userInfo.tenantId,
+    })
+    .then((message) => {
+      recursive(message.data);
+      deptTreeData.value = proxy.handleTree(message.data, "corporationId");
+    });
+  // 请款类型数据
+  proxy
+    .post("/dictTenantData/page", {
+      pageNum: 1,
+      pageSize: 999,
+      tenantId: tenantId,
+      dictCode: "founds_type",
+    })
+    .then((res) => {
+      fundsType.value = res.rows;
+      selectConfig[0].data = res.rows.map((x) => ({
+        label: x.dictValue,
+        value: x.dictKey,
+      }));
+    });
+  // 请款费用类型数据
+  proxy
+    .post("/dictTenantData/page", {
+      pageNum: 1,
+      pageSize: 999,
+      tenantId: tenantId,
+      dictCode: "funds_cost_type",
+    })
+    .then((res) => {
+      fundsCostType.value = res.rows;
+    });
+  // 请款付款方式数据
+  proxy
+    .post("/dictTenantData/page", {
+      pageNum: 1,
+      pageSize: 999,
+      tenantId: tenantId,
+      dictCode: "funds_payment_method",
+    })
+    .then((res) => {
+      fundsPaymentMethod.value = res.rows;
+    });
+
+  // 币种数据
+  proxy
+    .post("/dictTenantData/page", {
+      pageNum: 1,
+      pageSize: 999,
+      tenantId: tenantId,
+      dictCode: "account_currency",
+    })
+    .then((res) => {
+      currencyType.value = res.rows;
+    });
 };
 getList();
+getDictData();
 </script>
   
 <style lang="scss" scoped>

+ 48 - 6
src/views/process/processApproval/index.vue

@@ -147,6 +147,30 @@
       </el-tabs>
     </div>
   </div>
+  <el-dialog title="下一处理人" width="400" v-model="dialogVisible">
+    <el-form :model="flowForm">
+      <el-form-item prop="remark" label="处理人">
+        <el-select
+          v-model="flowForm.handleUserId"
+          placeholder="请选择"
+          filterable
+          style="width: 100%"
+        >
+          <el-option
+            v-for="item in nextHandleUser"
+            :label="item.name"
+            :value="item.id"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <div style="width: 100%; text-align: center">
+          <el-button type="primary" @click="handleSelectUser">提交 </el-button>
+        </div>
+      </el-form-item>
+    </el-form>
+  </el-dialog>
 </template>
 
 
@@ -182,6 +206,26 @@ const flowRules = reactive({
 const { proxy } = getCurrentInstance();
 const makeDom = ref(null);
 const flowFormDom = ref(null);
+let dialogVisible = ref(false);
+const nextHandleUser = ref([]);
+const handleSelectUser = () => {
+  if (!flowForm.handleUserId) {
+    return ElMessage({
+      message: "请选择下一节点处理人!",
+      type: "info",
+    });
+  }
+  handleSubmit();
+};
+
+const handleResult = (res) => {
+  if (res !== null && res.success === 1) {
+    skipPage();
+  } else {
+    dialogVisible.value = true;
+    nextHandleUser.value = res.userList;
+  }
+};
 // 提交逻辑
 const handleSubmit = async () => {
   try {
@@ -190,18 +234,17 @@ const handleSubmit = async () => {
     if (flag) {
       flowFormDom.value.validate((vaild) => {
         if (vaild) {
+          const data = { ...makeDom.value.submitData };
           if (queryData.data.isSubscribe == "10") {
-            const data = makeDom.value.submitData;
             data.subscribeDetailList = data.subscribeDetailList.map((x) => ({
               bussinessId: x.bussinessId,
               count: x.count,
               remark: x.remark,
             }));
             proxy.post("/subscribe/add", data).then((res) => {
-              skipPage();
+              handleResult(res);
             });
           } else if (queryData.data.isSubscribe == "20") {
-            const data = makeDom.value.submitData;
             data.purchaseDetailList = data.purchaseDetailList.map((x) => ({
               bussinessId: x.bussinessId,
               subscribeDetailId: x.id,
@@ -210,10 +253,9 @@ const handleSubmit = async () => {
               amount: x.amount,
             }));
             proxy.post("/purchase/add", data).then((res) => {
-              skipPage();
+              handleResult(res);
             });
           } else if (queryData.data.isSubscribe == "30") {
-            const data = makeDom.value.submitData;
             data.purchaseDetailList = data.purchaseDetailList.map((x) => ({
               bussinessId: x.bussinessId,
               subscribeDetailId: x.id,
@@ -222,7 +264,7 @@ const handleSubmit = async () => {
               amount: x.amount,
             }));
             proxy.post("/purchase/add", data).then((res) => {
-              skipPage();
+              handleResult(res);
             });
           }
         }

+ 24 - 26
src/views/product/product/index.vue

@@ -279,9 +279,7 @@ const fileList = ref([]);
 const fileListCopy = ref([]);
 
 let formData = reactive({
-  data: {
-  },
-  
+  data: {},
 });
 const formOption = reactive({
   inline: true,
@@ -354,31 +352,31 @@ const formConfig = computed(() => {
       itemType: "textarea",
     },
     {
-			type: 'json',
-			prop: 'standardJson',
-			json: [
-				{
-					type: 'input',
-					prop: 'englishName',
-					label: '英文名',
-				},
+      type: "json",
+      prop: "standardJson",
+      json: [
         {
-					type: 'input',
-					prop: 'code',
-					label: '备注',
-				},
+          type: "input",
+          prop: "englishName",
+          label: "英文名",
+        },
         {
-					type: 'input',
-					prop: 'netWeight',
-					label: '净重',
-				},
+          type: "input",
+          prop: "code",
+          label: "备注",
+        },
         {
-					type: 'input',
-					prop: 'customhouse',
-					label: '海关编码',
-				},
-			],
-		},
+          type: "input",
+          prop: "netWeight",
+          label: "净重",
+        },
+        {
+          type: "input",
+          prop: "customhouse",
+          label: "海关编码",
+        },
+      ],
+    },
   ];
 });
 const newPassword = () => {
@@ -439,7 +437,7 @@ const openModal = () => {
     definition: "1",
     type: "1",
     fileList: [],
-    standardJson:{},
+    standardJson: {},
   };
 
   fileList.value = [];

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

@@ -47,7 +47,7 @@
         <template #details>
           <div style="width: 100%">
             <el-button type="primary" @click="openProduct = true">
-              添加货品
+              选择
             </el-button>
 
             <el-form