Browse Source

部分新模块完成

cz 1 year ago
parent
commit
ecf0c1d5d3

+ 19 - 19
src/components/process/SF/Contract.vue

@@ -1162,13 +1162,13 @@ const formConfig = computed(() => {
       label: "交货期限",
       itemWidth: 50,
     },
-    {
-      type: "select",
-      prop: "transportMethod",
-      label: "运输方式",
-      data: shippingMethod.value,
-      itemWidth: 50,
-    },
+    // {
+    //   type: "select",
+    //   prop: "transportMethod",
+    //   label: "运输方式",
+    //   data: shippingMethod.value,
+    //   itemWidth: 50,
+    // },
     // {
     //   type: "select",
     //   prop: "taxTransportationWay",
@@ -1426,17 +1426,17 @@ const getDict = () => {
     });
   });
 
-  // proxy
-  //   .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
-  //   .then((res) => {
-  //     accountList.value = res.rows.map((item) => {
-  //       return {
-  //         ...item,
-  //         label: item.alias,
-  //         value: item.id,
-  //       };
-  //     });
-  //   });
+  proxy
+    .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
+    .then((res) => {
+      accountList.value = res.rows.map((item) => {
+        return {
+          ...item,
+          label: item.alias,
+          value: item.id,
+        };
+      });
+    });
 
   proxy
     .get("/tenantDept/list", {
@@ -1535,7 +1535,7 @@ const sellCorporationIdChange = (val) => {
 };
 
 const changeCustomer = (val) => {
-  formData.data.contractProductList = [];
+  // formData.data.contractProductList = [];
   if (val) {
     proxy.post("/customer/detail", { id: val }).then(
       (res) => {

+ 44 - 42
src/components/process/SF/ContractChange.vue

@@ -219,7 +219,7 @@
                     <el-table-column prop="productName" label="物料名称" width="170" />
                     <el-table-column label="规格尺寸 (cm)" width="130">
                       <template #default="{ row, $index }">
-                        <div style="width: 100%">
+                        <div style="width: 100%" v-if="row.productLength">
                           {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
                         </div>
                       </template>
@@ -1162,13 +1162,13 @@ const formConfig = computed(() => {
       label: "交货期限",
       itemWidth: 50,
     },
-    {
-      type: "select",
-      prop: "transportMethod",
-      label: "运输方式",
-      data: shippingMethod.value,
-      itemWidth: 50,
-    },
+    // {
+    //   type: "select",
+    //   prop: "transportMethod",
+    //   label: "运输方式",
+    //   data: shippingMethod.value,
+    //   itemWidth: 50,
+    // },
     // {
     //   type: "select",
     //   prop: "taxTransportationWay",
@@ -1426,17 +1426,17 @@ const getDict = () => {
     });
   });
 
-  // proxy
-  //   .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
-  //   .then((res) => {
-  //     accountList.value = res.rows.map((item) => {
-  //       return {
-  //         ...item,
-  //         label: item.alias,
-  //         value: item.id,
-  //       };
-  //     });
-  //   });
+  proxy
+    .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
+    .then((res) => {
+      accountList.value = res.rows.map((item) => {
+        return {
+          ...item,
+          label: item.alias,
+          value: item.id,
+        };
+      });
+    });
 
   proxy
     .get("/tenantDept/list", {
@@ -1535,7 +1535,7 @@ const sellCorporationIdChange = (val) => {
 };
 
 const changeCustomer = (val) => {
-  formData.data.contractProductList = [];
+  // formData.data.contractProductList = [];
   if (val) {
     proxy.post("/customer/detail", { id: val }).then(
       (res) => {
@@ -1665,27 +1665,25 @@ const selectProduct = async (goods) => {
     }
     proxy.post("/productBomInfo/detail", { id: goods.id }).then((res) => {
       if (res.productBomDetailList && res.productBomDetailList.length > 0) {
-        contractProductBomList.value = res.productBomDetailList
-          .filter((x) => x.type != 3)
-          .map((x) => ({
-            fileUrl: "",
-            materialId: x.materialId,
-            productName: x.materialName,
-            productCode: x.materialCode,
-            productLength: x.materialLength,
-            productWidth: x.materialWidth,
-            productHeight: x.materialHeight,
-            productColor: x.materialColor,
-            standardDosage: x.standardDosage,
-            lossRate: x.lossRate,
-            remark: x.remark || "",
-            quantity: null,
-            allQuantity: "",
-            price: x.materialPrice || null,
-            amount: "",
-            fileList: [],
-            type: x.type,
-          }));
+        contractProductBomList.value = res.productBomDetailList.map((x) => ({
+          fileUrl: "",
+          materialId: x.materialId,
+          productName: x.materialName,
+          productCode: x.materialCode,
+          productLength: x.materialLength,
+          productWidth: x.materialWidth,
+          productHeight: x.materialHeight,
+          productColor: x.materialColor,
+          standardDosage: x.standardDosage,
+          lossRate: x.lossRate,
+          remark: x.remark || "",
+          quantity: x.type != 3 ? null : 1,
+          allQuantity: "",
+          price: x.materialPrice || null,
+          amount: "",
+          fileList: [],
+          type: x.type,
+        }));
         let fileListOne = [];
         if (allFile && allFile.length > 0) {
           fileListOne = allFile.filter((x) => x.businessType == "2");
@@ -1849,7 +1847,11 @@ const calculationAmount = (flag = flase) => {
         for (let j = 0; j < row.contractProductBomList.length; j++) {
           let jrow = row.contractProductBomList[j];
           jrow.quantity = Math.ceil(
-            (row.quantity / jrow.standardDosage) * (1 + jrow.lossRate / 100)
+            Number(
+              parseFloat(
+                (row.quantity / jrow.standardDosage) * (1 + jrow.lossRate / 100)
+              ).toFixed(2)
+            )
           );
         }
       }

+ 239 - 0
src/components/process/SF/EncodingCombination.vue

@@ -0,0 +1,239 @@
+<template>
+  <div style="width: 100%; padding: 0px 15px">
+    <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom">
+    </byForm>
+  </div>
+</template>
+
+<script setup>
+import byForm from "@/components/byForm/index";
+import { useRoute } from "vue-router";
+const { proxy } = getCurrentInstance();
+const route = useRoute();
+// 接收父组件的传值
+const props = defineProps({
+  queryData: Object,
+});
+const selectData = ref([]);
+const userList = ref([]);
+const deptData = ref([]);
+
+const formData = reactive({
+  data: {
+    fileList: [],
+  },
+});
+const formDom = ref(null);
+const judgeStatus = () => {
+  if (route.query.processType == 20 || route.query.processType == 10) {
+    return true;
+  }
+  if (props.queryData.recordList && props.queryData.recordList.length > 0) {
+    let data = props.queryData.recordList.filter(
+      (item) => item.status === 2 && item.nodeType !== 1
+    );
+    if (data && data.length > 0) {
+      return true;
+    }
+  }
+  return false;
+};
+const formOption = reactive({
+  inline: true,
+  labelWidth: 130,
+  itemWidth: 100,
+  disabled: false,
+});
+const formConfig = computed(() => {
+  return [
+    {
+      type: "title",
+      title: "基本信息",
+      haveLine: false,
+    },
+    {
+      type: "input",
+      prop: "code",
+      label: "流水号",
+      placeholder: " ",
+      itemWidth: 50,
+      disabled: true,
+    },
+    {
+      type: "date",
+      prop: "applyTime",
+      itemType: "date",
+      label: "申请日期",
+      itemWidth: 50,
+      disabled: false,
+    },
+    {
+      type: "select",
+      prop: "createUser",
+      label: "申请人",
+      required: true,
+      filterable: true,
+      data: userList.value,
+      itemWidth: 50,
+      disabled: true,
+    },
+    {
+      type: "treeSelect",
+      prop: "companyId",
+      label: "所属公司",
+      data: proxy.useUserStore().allDict["tree_company_data"],
+      propsTreeLabel: "deptName",
+      propsTreeValue: "deptId",
+      itemWidth: 50,
+      fn: (val) => {},
+      disabled: true,
+    },
+    {
+      type: "treeSelect",
+      prop: "deptId",
+      label: "所属部门",
+      data: deptData.value,
+      propsTreeLabel: "deptName",
+      propsTreeValue: "deptId",
+      itemWidth: 50,
+      disabled: true,
+    },
+    {
+      type: "upload",
+      listType: "text",
+      accept: "",
+      prop: "fileList",
+      label: "申请附件",
+    },
+    {
+      type: "input",
+      prop: "remark",
+      itemType: "textarea",
+      label: "描述商品编码组合",
+      itemWidth: 100,
+      disabled: false,
+    },
+  ];
+});
+
+const rules = ref({
+  applyTime: [{ required: true, message: "请选择申请日期", trigger: "change" }],
+  companyId: [{ required: true, message: "请选择所属公司", trigger: "change" }],
+  deptId: [{ required: true, message: "请选择所属部门", trigger: "change" }],
+  createUser: [{ required: true, message: "请选择申请人", trigger: "change" }],
+  educationId: [{ required: true, message: "请选择学历", trigger: "change" }],
+  // fileList: [{ required: true, message: "请上传申请附件", trigger: "change" }],
+});
+
+const getDeptData = () => {
+  proxy
+    .get("/tenantUser/list", {
+      pageNum: 1,
+      pageSize: 10000,
+      tenantId: proxy.useUserStore().user.tenantId,
+      companyId: proxy.useUserStore().user.companyId,
+    })
+    .then((res) => {
+      userList.value = res.rows.map((item) => {
+        return {
+          label: item.nickName,
+          value: item.userId,
+        };
+      });
+    });
+
+  proxy
+    .get("/tenantDept/list", {
+      pageNum: 1,
+      pageSize: 9999,
+      keyword: "",
+      ancestors: proxy.useUserStore().user.companyId,
+      tenantId: proxy.useUserStore().user.tenantId,
+      // type: 2,
+    })
+    .then((res) => {
+      deptData.value = proxy.handleTree(res.data, "deptId");
+    });
+};
+getDeptData();
+
+const getDict = () => {
+  proxy
+    .post("/educationConfig/page", {
+      pageNum: 1,
+      pageSize: 999,
+    })
+    .then((res) => {
+      selectData.value = res.rows.map((x) => ({
+        ...x,
+        label: x.name,
+        value: x.id,
+      }));
+    });
+};
+// getDict();
+
+const handleSubmit = async (isStag = false) => {
+  if (isStag) {
+    return true;
+  }
+  let flag = await formDom.value.handleSubmit(() => {});
+  if (flag) {
+    return true;
+  } else {
+    setTimeout(() => {
+      const errorDiv = document.getElementsByClassName("is-error");
+      errorDiv[0].scrollIntoView();
+    }, 0);
+  }
+  return flag;
+};
+
+const getFormData = () => {
+  return proxy.deepClone(formData.data);
+};
+// 向父组件暴露
+defineExpose({
+  getFormData,
+  handleSubmit,
+});
+
+const getAllData = (businessId) => {
+  if (businessId) {
+    proxy.post("/erpCodingGroup/detail", { id: businessId }).then((res) => {
+      formData.data = res;
+      proxy
+        .post("/fileInfo/getList", { businessIdList: [businessId] })
+        .then((fileObj) => {
+          if (fileObj[businessId] && fileObj[businessId].length > 0) {
+            formData.data.fileList = fileObj[businessId]
+              .filter((x) => x.businessType == "0")
+              .map((item) => {
+                return {
+                  ...item,
+                  name: item.fileName,
+                  url: item.fileUrl,
+                };
+              });
+          } else {
+            formData.data.fileList = [];
+          }
+        });
+    });
+  }
+};
+
+onMounted(() => {
+  formOption.disabled = judgeStatus();
+  formData.data.applyTime = proxy.parseTime(new Date());
+  formData.data.companyId = proxy.useUserStore().user.companyId;
+  formData.data.deptId = proxy.useUserStore().user.dept.deptId;
+  formData.data.createUser = proxy.useUserStore().user.userId;
+  if (route.query.businessId) {
+    getAllData(route.query.businessId);
+  }
+});
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 183 - 75
src/components/process/SF/UseSeal.vue

@@ -1,26 +1,56 @@
 <template>
   <div style="width: 100%; padding: 0px 15px">
     <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom">
-
+      <template #btn>
+        <div style="width:100%;display:flex">
+          <div style="width:calc(100% - 105px)">
+            <el-form-item label="关联销售合同" prop="contractCode" class="margin-b-0">
+              <el-input disabled v-model="formData.data.contractCode" placeholder="请选择"></el-input>
+            </el-form-item>
+          </div>
+          <el-button type="primary" style="width:88px;margin-left:15px" @click="openSelectContrct = true" plain>选择订单</el-button>
+        </div>
+      </template>
     </byForm>
-
+    <el-dialog v-model="openSelectContrct" title="选择订单" width="80%" append-to-body>
+      <ContractSelect @handleSelectContrct="handleSelectContrct"></ContractSelect>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="openSelectContrct = false">取消</el-button>
+        </span>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
 <script setup>
 import byForm from "@/components/byForm/index";
 import { useRoute } from "vue-router";
+import ContractSelect from "@/views/salesMange/saleContract/contractSelect/index";
+
 const { proxy } = getCurrentInstance();
 const route = useRoute();
 // 接收父组件的传值
 const props = defineProps({
   queryData: Object,
 });
+const openSelectContrct = ref(false);
 const sealType = computed(() => proxy.useUserStore().allDict["seal_type"]);
+const sealCategory = computed(
+  () => proxy.useUserStore().allDict["seal_category"]
+);
+const sealIsContract = computed(
+  () => proxy.useUserStore().allDict["seal_is_contract"]
+);
+const selectData = ref([]);
 const userList = ref([]);
-const sss = ref([]);
 const formData = reactive({
-  data: {},
+  data: {
+    useMethod: "2",
+    fileList: [],
+    companyFileList: [],
+    customerFileList: [],
+  },
 });
 const formDom = ref(null);
 const judgeStatus = () => {
@@ -59,7 +89,7 @@ const formConfig = computed(() => {
     },
     {
       type: "select",
-      prop: "subcribeUserId",
+      prop: "createUser",
       label: "申请人",
       required: true,
       filterable: true,
@@ -68,7 +98,7 @@ const formConfig = computed(() => {
     },
     {
       type: "date",
-      prop: "subcribeTime",
+      prop: "applyTime",
       itemType: "date",
       label: "申请日期",
       itemWidth: 50,
@@ -76,16 +106,16 @@ const formConfig = computed(() => {
     },
     {
       type: "select",
-      prop: "subcribeUserId",
+      prop: "sealIds",
       label: "印章名称",
       filterable: true,
       multiple: true,
-      data: sss.value,
+      data: selectData.value,
       itemWidth: 50,
     },
     {
       type: "select",
-      prop: "subcribeUserId",
+      prop: "useMethod",
       label: "使用方式",
       filterable: true,
       data: [
@@ -106,125 +136,184 @@ const formConfig = computed(() => {
       label: "印章类型",
       data: sealType.value,
       itemWidth: 50,
+      isShow: formData.data.useMethod == "2",
     },
     {
       type: "select",
-      prop: "subcribeUserId",
+      prop: "isStamped",
       label: "是否盖过章",
       filterable: true,
       data: [
         {
-          label: "借章",
-          value: "1",
+          label: "",
+          value: 1,
         },
         {
-          label: "盖章",
-          value: "2",
+          label: "",
+          value: 0,
         },
       ],
       itemWidth: 50,
     },
     {
       type: "select",
-      prop: "sealType",
+      prop: "stampedType",
       label: "盖章类别",
-      data: sealType.value,
+      data: sealCategory.value,
       itemWidth: 50,
     },
-    {
-      type: "upload",
-      listType: "text",
-      accept: "",
-      prop: "fileList",
-      label: "需盖章文件",
-    },
+
     {
       type: "select",
-      prop: "subcribeUserId",
+      prop: "isContract",
       label: "是否销售合同",
       filterable: true,
-      data: [
-        {
-          label: "借章",
-          value: "1",
-        },
-        {
-          label: "盖章",
-          value: "2",
-        },
-      ],
+      data: sealIsContract.value,
       itemWidth: 50,
+      isShow: formData.data.useMethod == "2",
     },
     {
       type: "slot",
       slotName: "btn",
-      label: "关联销售合同",
+      label: "",
       itemWidth: 50,
+      isShow: formData.data.useMethod == "2",
     },
     {
       type: "date",
-      prop: "subcribeTime",
+      prop: "borrowTime",
       itemType: "date",
       label: "借出日期",
       itemWidth: 50,
       disabled: false,
+      isShow: formData.data.useMethod == "1",
     },
     {
       type: "date",
-      prop: "subcribeTime",
+      prop: "returnedTime",
       itemType: "date",
       label: "归还日期",
       itemWidth: 50,
       disabled: false,
+      isShow: formData.data.useMethod == "1",
     },
 
     {
       type: "input",
-      prop: "subcribeContent",
+      prop: "remark",
       itemType: "textarea",
       label: "借出用途说明",
       itemWidth: 100,
       disabled: false,
+      isShow: formData.data.useMethod == "1",
+    },
+    {
+      type: "upload",
+      listType: "text",
+      accept: "",
+      prop: "fileList",
+      label: "需盖章文件",
+      isShow: formData.data.useMethod == "2",
+    },
+    {
+      type: "upload",
+      listType: "text",
+      accept: "",
+      prop: "companyFileList",
+      label: "公司已盖章文件",
+      isShow: formData.data.useMethod == "2",
+    },
+    {
+      type: "upload",
+      listType: "text",
+      accept: "",
+      prop: "customerFileList",
+      label: "客户已盖章文件",
+      isShow: formData.data.useMethod == "2",
     },
   ];
 });
 
 const rules = ref({
-  companyId: [{ required: true, message: "请选择业务公司", trigger: "change" }],
-  deptId: [{ required: true, message: "请选择业务部门", trigger: "change" }],
-  subcribeUserId: [
-    { required: true, message: "请选择申请人", trigger: "change" },
+  createUser: [{ required: true, message: "请选择申请人", trigger: "change" }],
+  applyTime: [{ required: true, message: "请选择申请日期", trigger: "change" }],
+  sealIds: [{ required: true, message: "请选择印章名称", trigger: "change" }],
+  useMethod: [{ required: true, message: "请选择使用方式", trigger: "change" }],
+  isStamped: [
+    { required: true, message: "请选择是否盖过章", trigger: "change" },
   ],
-  subcribeTime: [
-    { required: true, message: "请选择申购时间", trigger: "change" },
+  sealType: [{ required: true, message: "请选择印章类型", trigger: "change" }],
+  stampedType: [
+    { required: true, message: "请选择盖章类别", trigger: "change" },
   ],
-  putWarehouseId: [
-    { required: true, message: "请选择入库仓库", trigger: "change" },
+  isContract: [
+    { required: true, message: "请选择是否销售合同", trigger: "change" },
   ],
-  isSubstitute: [
-    { required: true, message: "请选择是否代他人提交", trigger: "change" },
+  borrowTime: [
+    { required: true, message: "请选择借出日期", trigger: "change" },
   ],
-  isInStock: [{ required: true, message: "请选择是否入库", trigger: "change" }],
-  isAppoint: [
-    { required: true, message: "请选择是否指定供应商", trigger: "change" },
+  returnedTime: [
+    { required: true, message: "请选择归还日期", trigger: "change" },
   ],
-  supplierId: [{ required: true, message: "请选择供应商", trigger: "change" }],
-  purposeRemark: [
-    { required: true, message: "请输入申请用途", trigger: "blur" },
+  remark: [{ required: true, message: "请输入借出用途说明", trigger: "blur" }],
+  fileList: [
+    { required: true, message: "请选择需盖章文件", trigger: "change" },
   ],
-  count: [{ required: true, message: "请输入数量", trigger: "blur" }],
-  price: [{ required: true, message: "请输入单价(不含税)", trigger: "blur" }],
-  priceIncludingTax: [
-    { required: true, message: "请输入单价(含税)", trigger: "blur" },
+  contractCode: [
+    { required: true, message: "请选择销售订单", trigger: "blur" },
   ],
 });
 
+const getDeptData = () => {
+  proxy
+    .get("/tenantUser/list", {
+      pageNum: 1,
+      pageSize: 10000,
+      tenantId: proxy.useUserStore().user.tenantId,
+      companyId: proxy.useUserStore().user.companyId,
+    })
+    .then((res) => {
+      userList.value = res.rows.map((item) => {
+        return {
+          label: item.nickName,
+          value: item.userId,
+        };
+      });
+    });
+};
+getDeptData();
+
+const getDict = () => {
+  proxy
+    .post("sealConfig/page", {
+      pageNum: 1,
+      pageSize: 999,
+    })
+    .then((res) => {
+      selectData.value = res.rows.map((x) => ({
+        ...x,
+        label: x.name,
+        value: x.id,
+      }));
+    });
+};
+getDict();
+
+const handleSelectContrct = async (row) => {
+  formData.data.contractId = row.id;
+  formData.data.contractCode = row.code;
+  openSelectContrct.value = false;
+  return proxy.msgTip("选择成功", 1);
+};
+
 const handleSubmit = async (isStag = false) => {
   if (isStag) {
+    formData.data.sealIds = formData.data.sealIds.join(",");
     return true;
   }
   let flag = await formDom.value.handleSubmit(() => {});
   if (flag) {
+    formData.data.sealIds = formData.data.sealIds.join(",");
     return true;
   } else {
     setTimeout(() => {
@@ -246,24 +335,20 @@ defineExpose({
 
 const getAllData = (businessId) => {
   if (businessId) {
-    proxy.post("/subscribe/detail", { id: businessId }).then((res) => {
-      formData.data = res;
-      if (formData.data.supplierId) {
-        formData.data.isAppoint = "1";
-        changeSupplier(formData.data.supplierId);
+    proxy.post("/sealUse/detail", { id: businessId }).then((res) => {
+      if (res.sealIds) {
+        res.sealIds = res.sealIds.split(",");
       } else {
-        formData.data.isAppoint = "0";
-      }
-      if (formData.data.companyId) {
-        getDeptData(formData.data.companyId);
+        res.sealIds = [];
       }
+      formData.data = res;
 
       proxy
         .post("/fileInfo/getList", { businessIdList: [businessId] })
         .then((fileObj) => {
           if (fileObj[businessId] && fileObj[businessId].length > 0) {
-            formData.data.purposeFileList = fileObj[businessId]
-              .filter((x) => x.businessType == "15")
+            formData.data.fileList = fileObj[businessId]
+              .filter((x) => x.businessType == "10")
               .map((item) => {
                 return {
                   ...item,
@@ -271,8 +356,17 @@ const getAllData = (businessId) => {
                   url: item.fileUrl,
                 };
               });
-            formData.data.substituteFileList = fileObj[businessId]
-              .filter((x) => x.businessType == "10")
+            formData.data.companyFileList = fileObj[businessId]
+              .filter((x) => x.businessType == "20")
+              .map((item) => {
+                return {
+                  ...item,
+                  name: item.fileName,
+                  url: item.fileUrl,
+                };
+              });
+            formData.data.customerFileList = fileObj[businessId]
+              .filter((x) => x.businessType == "30")
               .map((item) => {
                 return {
                   ...item,
@@ -281,8 +375,9 @@ const getAllData = (businessId) => {
                 };
               });
           } else {
-            formData.data.purposeFileList = [];
-            formData.data.substituteFileList = [];
+            formData.data.fileList = [];
+            formData.data.companyFileList = [];
+            formData.data.customerFileList = [];
           }
         });
     });
@@ -291,11 +386,24 @@ const getAllData = (businessId) => {
 
 onMounted(() => {
   formOption.disabled = judgeStatus();
-  formData.data.subcribeTime = proxy.parseTime(new Date());
-  formData.data.subcribeUserId = proxy.useUserStore().user.userId;
+  formData.data.applyTime = proxy.parseTime(new Date());
+  formData.data.createUser = proxy.useUserStore().user.userId;
   if (route.query.businessId) {
     getAllData(route.query.businessId);
   }
+  // 删除莫名多出的一个textarea
+  nextTick(() => {
+    setTimeout(() => {
+      let dom = document.getElementsByTagName("textarea");
+      if (dom && dom.length > 0) {
+        for (let i = 0; i < dom.length; i++) {
+          if (!dom[i].className) {
+            dom[i].style.display = "none";
+          }
+        }
+      }
+    }, 100);
+  });
 });
 </script>
 

+ 21 - 0
src/hooks/refreshTableData.js

@@ -0,0 +1,21 @@
+import {
+  onMounted,
+  onBeforeUnmount
+} from "vue";
+import $bus from "@/bus/index.js";
+
+function useRefreshTableData(fn) {
+
+  onMounted(() => {
+    $bus.on("refreshTableData", () => {
+      fn()
+    });
+  });
+
+  onBeforeUnmount(() => {
+    $bus.off("refreshTableData");
+  });
+
+}
+
+export default useRefreshTableData;

+ 1 - 0
src/views/EHSD/saleContract/PriceSheetDetail.vue

@@ -287,6 +287,7 @@
                       <!-- <el-table-column prop="quantity" label="数量" width="100" /> -->
                       <el-table-column prop="standardDosage" label="标准用量" width="100" />
                       <el-table-column prop="lossRate" label="损耗率(%)" width="100" />
+                      <el-table-column prop="quantity" label="数量" width="100" />
                       <el-table-column prop="remark" label="备注" min-width="150" />
                     </el-table>
                   </div>

+ 39 - 7
src/views/EHSD/saleContract/priceSheetEHSD/index.vue

@@ -193,7 +193,7 @@
                         <el-form-item label="数量" class="margin-b-0" :prop="'quotationProductList.' +index + '.quantity'" :rules="rules.quantity"
                                       :inline-message="true" @click.stop>
                           <el-input-number v-model="product.quantity" placeholder="请输入" style="width: 100%" :precision="0" :controls="false" :min="1"
-                                           onmousewheel="return false;" />
+                                           onmousewheel="return false;" @change="()=>handleChangeQuantity(index)" />
                         </el-form-item>
                       </el-col>
                       <el-col :span="5" style="padding-left:15px">
@@ -342,7 +342,7 @@
                               <el-form-item :prop="'quotationProductList.' + index + '.quotationProductBomList.' + $index + '.standardDosage'"
                                             :rules="rules.standardDosage" :inline-message="true" class="margin-b-0 wid100">
                                 <el-input-number onmousewheel="return false;" v-model="row.standardDosage" placeholder="请输入" style="width: 100%"
-                                                 :precision="0" :controls="false" :min="1" />
+                                                 :precision="0" :controls="false" :min="1" @change="()=>handleChangeQuantity(index)" />
                               </el-form-item>
                             </div>
                           </template>
@@ -353,11 +353,12 @@
                               <el-form-item :prop="'quotationProductList.' + index + '.quotationProductBomList.' + $index + '.lossRate'"
                                             :rules="rules.lossRate" :inline-message="true" class="margin-b-0 wid100">
                                 <el-input-number onmousewheel="return false;" v-model="row.lossRate" placeholder="请输入" style="width: 100%"
-                                                 :precision="2" :controls="false" :min="0" :max="100" />
+                                                 :precision="2" :controls="false" :min="0" :max="100" @change="()=>handleChangeQuantity(index)" />
                               </el-form-item>
                             </div>
                           </template>
                         </el-table-column>
+                        <el-table-column prop="quantity" label="数量" width="100" />
                         <el-table-column label="备注" min-width="200">
                           <template #default="{ row, $index }">
                             <div style="width: 100%">
@@ -734,9 +735,9 @@
                             </template>
                           </el-table-column>
                           <el-table-column prop="productColor" label="颜色" width="170" />
-                          <!-- <el-table-column prop="quantity" label="数量" width="100" /> -->
                           <el-table-column prop="standardDosage" label="标准用量" width="100" />
                           <el-table-column prop="lossRate" label="损耗率(%)" width="100" />
+                          <el-table-column prop="quantity" label="数量" width="100" />
                           <el-table-column prop="remark" label="备注" min-width="150" />
                         </el-table>
                       </div>
@@ -1051,9 +1052,9 @@
                             </template>
                           </el-table-column>
                           <el-table-column prop="productColor" label="颜色" width="170" />
-                          <!-- <el-table-column prop="quantity" label="数量" width="100" /> -->
                           <el-table-column prop="standardDosage" label="标准用量" width="100" />
                           <el-table-column prop="lossRate" label="损耗率(%)" width="100" />
+                          <el-table-column prop="quantity" label="数量" width="100" />
                           <el-table-column prop="remark" label="备注" min-width="150" />
                         </el-table>
                       </div>
@@ -2107,7 +2108,10 @@ const selectProduct = (row) => {
           // quotationProductBomList: goods.productBomDetailList.filter(
           //   (x) => x.type == 2
           // ),
-          quotationProductBomList: goods.productBomDetailList,
+          quotationProductBomList: goods.productBomDetailList.map((x) => ({
+            ...x,
+            quantity: null,
+          })),
           quotationProductCustomInfoList: quotationProductCustomInfoList,
         });
         activeNames.value.push(formData.data.quotationProductList.length - 1);
@@ -3306,7 +3310,6 @@ const selectTechnology = (row) => {
 };
 
 const selectMaterial = (goods) => {
-  console.log(goods, "awdwad");
   let flag = formData.data.quotationProductList[
     indexValue.value
   ].quotationProductBomList.some((x) => x.materialId == goods.id);
@@ -3340,6 +3343,35 @@ const selectMaterial = (goods) => {
     proxy.msgTip("该物料已选择", 2);
   }
 };
+
+const handleChangeQuantity = (index) => {
+  if (
+    formData.data.quotationProductList &&
+    formData.data.quotationProductList.length > 0
+  ) {
+    for (let i = 0; i < formData.data.quotationProductList.length; i++) {
+      let row = formData.data.quotationProductList[i];
+      if (
+        row.quotationProductBomList &&
+        row.quotationProductBomList.length > 0
+      ) {
+        for (let j = 0; j < row.quotationProductBomList.length; j++) {
+          let jrow = row.quotationProductBomList[j];
+          if (row.quantity) {
+            jrow.quantity = Math.ceil(
+              Number(
+                parseFloat(
+                  (row.quantity / jrow.standardDosage) *
+                    (1 + jrow.lossRate / 100)
+                ).toFixed(2)
+              )
+            );
+          }
+        }
+      }
+    }
+  }
+};
 </script>
 
 <style lang="scss" scoped>

+ 2 - 2
src/views/EHSD/saleContract/priceSheetEstimate/index.vue

@@ -229,9 +229,9 @@
                           </template>
                         </el-table-column>
                         <el-table-column prop="productColor" label="颜色" width="170" />
-                        <!-- <el-table-column prop="quantity" label="数量" width="100" /> -->
                         <el-table-column prop="standardDosage" label="标准用量" width="100" />
                         <el-table-column prop="lossRate" label="损耗率(%)" width="100" />
+                        <el-table-column prop="quantity" label="数量" width="100" />
                         <el-table-column prop="remark" label="备注" min-width="150" />
                       </el-table>
                     </div>
@@ -750,9 +750,9 @@
                   </template>
                 </el-table-column>
                 <el-table-column prop="productColor" label="颜色" width="170" />
-                <!-- <el-table-column prop="quantity" label="数量" width="100" /> -->
                 <el-table-column prop="standardDosage" label="标准用量" width="100" />
                 <el-table-column prop="lossRate" label="损耗率(%)" width="100" />
+                <el-table-column prop="quantity" label="数量" width="100" />
                 <el-table-column prop="remark" label="备注" min-width="150" />
               </el-table>
             </div>

+ 12 - 1
src/views/oa/application/educationSubsidy/index.vue

@@ -34,7 +34,7 @@ import { computed, ref } from "vue";
 import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import useUserStore from "@/store/modules/user";
-import { ElMessage, ElMessageBox } from "element-plus";
+import $bus from "@/bus/index.js";
 
 const { proxy } = getCurrentInstance();
 const sealType = computed(() => proxy.useUserStore().allDict["seal_type"]);
@@ -475,6 +475,17 @@ const getDtl = (row) => {
     },
   });
 };
+
+onMounted(() => {
+  $bus.on("refreshTableData", () => {
+    getList();
+  });
+});
+
+onBeforeUnmount(() => {
+  // 取消订阅特定事件
+  $bus.off("refreshTableData");
+});
 </script>
 
 <style lang="scss" scoped>

+ 497 - 0
src/views/oa/application/encodingCombination/index.vue

@@ -0,0 +1,497 @@
+<template>
+  <div class="pageIndexClass">
+    <div class="content">
+      <byTable :source="sourceList.data" :pagination="sourceList.pagination" :selectConfig="selectConfig" :config="config" :loading="loading"
+               highlight-current-row :action-list="[
+          {
+            text: '添加',
+            action: () => openModal('add'),
+          },
+        ]" @get-list="getList">
+
+        <template #code="{item}">
+          <div style="width:100%">
+            <span class="el-click" @click="getDtl(item)">{{item.code}}</span>
+          </div>
+        </template>
+      </byTable>
+    </div>
+
+    <el-dialog :title="modalType == 'add' ? '添加' : '编辑'" v-if="dialogVisible" v-model="dialogVisible" width="60%">
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit" v-loading="loadingDialog">
+
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="default">取 消</el-button>
+        <el-button type="primary" @click="submitForm()" size="default">确 定</el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import { computed, ref } from "vue";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import useUserStore from "@/store/modules/user";
+// import $bus from "@/bus/index.js";
+import useRefreshTableData from "@/hooks/refreshTableData";
+
+const { proxy } = getCurrentInstance();
+const sealType = computed(() => proxy.useUserStore().allDict["seal_type"]);
+const userList = ref([]);
+const deptData = ref([]);
+const typeData = ref([
+  {
+    label: "收入",
+    value: "10",
+  },
+  {
+    label: "支出",
+    value: "20",
+  },
+]);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+  },
+});
+const loading = ref(false);
+const statusData = ref([
+  {
+    label: "草稿",
+    value: 0,
+  },
+  {
+    label: "审批中",
+    value: 10,
+  },
+  {
+    label: "审批驳回",
+    value: 20,
+  },
+  {
+    label: "审批通过",
+    value: 30,
+  },
+  {
+    label: "作废",
+    value: 88,
+  },
+]);
+const selectConfig = computed(() => {
+  return [
+    {
+      label: "审批状态",
+      prop: "status",
+      data: statusData.value,
+    },
+  ];
+});
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "流水号",
+        slot: "code",
+        width: 150,
+      },
+    },
+
+    // {
+    //   attrs: {
+    //     label: "印章类型",
+    //     prop: "type",
+    //   },
+    //   render(val) {
+    //     return proxy.dictKeyValue(val, sealType.value);
+    //   },
+    // },
+    {
+      attrs: {
+        label: "申请人",
+        prop: "createUserName",
+        width: 130,
+      },
+    },
+    {
+      attrs: {
+        label: "申请日期",
+        prop: "applyTime",
+        width: 110,
+      },
+    },
+    {
+      attrs: {
+        label: "所属中心",
+        prop: "companyName",
+        width: 110,
+      },
+    },
+    {
+      attrs: {
+        label: "所属部门",
+        prop: "deptName",
+        width: 110,
+      },
+    },
+    {
+      attrs: {
+        label: "描述商品编码组合",
+        prop: "remark",
+      },
+    },
+
+    {
+      attrs: {
+        label: "审批状态",
+        prop: "status",
+        width: 100,
+      },
+      render(type) {
+        return proxy.dictValueLabel(type, statusData.value);
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "120",
+        align: "center",
+      },
+      renderHTML(row) {
+        return [
+          row.status == 0
+            ? {
+                attrs: {
+                  label: "修改",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  clickUpdate(row);
+                },
+              }
+            : {},
+          row.status == 0
+            ? {
+                attrs: {
+                  label: "删除",
+                  type: "danger",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  proxy
+                    .msgConfirm()
+                    .then((res) => {
+                      proxy
+                        .post("/erpCodingGroup/delete", {
+                          id: row.id,
+                        })
+                        .then((res) => {
+                          proxy.msgTip("操作成功", 1);
+                          getList();
+                        });
+                    })
+                    .catch((err) => {});
+                },
+              }
+            : {},
+          row.status == 10 || row.status == 30
+            ? {
+                attrs: {
+                  label: "作废",
+                  type: "danger",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  proxy
+                    .msgConfirm()
+                    .then((res) => {
+                      proxy
+                        .post("/erpCodingGroup/cancellation", {
+                          id: row.id,
+                        })
+                        .then((res) => {
+                          proxy.msgTip("操作成功", 1);
+                          getList();
+                        });
+                    })
+                    .catch((err) => {});
+                },
+              }
+            : {},
+        ];
+      },
+    },
+  ];
+});
+const corporationList = ref([]);
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy
+    .post("/erpCodingGroup/page", sourceList.value.pagination)
+    .then((res) => {
+      sourceList.value.data = res.rows;
+      sourceList.value.pagination.total = res.total;
+      setTimeout(() => {
+        loading.value = false;
+      }, 200);
+    });
+};
+getList();
+const getDeptData = (val) => {
+  proxy
+    .get("/tenantUser/list", {
+      pageNum: 1,
+      pageSize: 10000,
+      tenantId: proxy.useUserStore().user.tenantId,
+      companyId: proxy.useUserStore().user.companyId,
+    })
+    .then((res) => {
+      userList.value = res.rows.map((item) => {
+        return {
+          ...item,
+          label: item.nickName,
+          value: item.userId,
+        };
+      });
+    });
+
+  proxy
+    .get("/tenantDept/list", {
+      pageNum: 1,
+      pageSize: 9999,
+      keyword: "",
+      ancestors: proxy.useUserStore().user.companyId,
+      tenantId: proxy.useUserStore().user.tenantId,
+      // type: 2,
+    })
+    .then((res) => {
+      deptData.value = proxy.handleTree(res.data, "deptId");
+    });
+};
+getDeptData();
+const modalType = ref("add");
+const dialogVisible = ref(false);
+const loadingDialog = ref(false);
+const submit = ref(null);
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const formConfig = computed(() => {
+  return [
+    {
+      type: "title1",
+      title: "基本信息",
+    },
+    {
+      type: "input",
+      prop: "name",
+      label: "印章名称",
+      required: true,
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
+      type: "select",
+      prop: "sealType",
+      label: "印章类型",
+      data: sealType.value,
+      itemWidth: 50,
+    },
+    {
+      type: "select",
+      prop: "applyUserId",
+      label: "存管人员",
+      required: true,
+      filterable: true,
+      data: userList.value,
+      itemWidth: 50,
+      fn: (val) => {
+        let current = userList.value.find((x) => x.value == val);
+        console.log(current, "ada");
+        if (current) {
+          formData.data.deptId = current.deptId;
+        }
+      },
+    },
+    {
+      type: "treeSelect",
+      prop: "deptId",
+      label: "存管部门",
+      data: deptData.value,
+      propsTreeLabel: "deptName",
+      propsTreeValue: "deptId",
+      itemWidth: 50,
+      disabled: 50,
+    },
+    {
+      type: "input",
+      prop: "accountNumber",
+      label: "印章用途",
+      itemWidth: 100,
+      itemType: "textarea",
+    },
+  ];
+});
+const rules = ref({
+  name: [{ required: true, message: "请输入承包商", trigger: "blur" }],
+  taxPoints: [{ required: true, message: "请输入税点", trigger: "blur" }],
+  accountBank: [{ required: true, message: "请输入开户行", trigger: "blur" }],
+  accountName: [{ required: true, message: "请输入开户名", trigger: "blur" }],
+  accountNumber: [{ required: true, message: "请输入账号", trigger: "blur" }],
+});
+const formData = reactive({
+  data: {
+    accountRemainderList: [{ currency: "", remainder: undefined }],
+  },
+});
+const openModal = (val) => {
+  // modalType.value = val;
+  // formData.data = {
+  //   accountRemainderList: [{ currency: "", remainder: undefined }],
+  // };
+  // loadingDialog.value = false;
+  // dialogVisible.value = true;
+  proxy.$router.replace({
+    path: "/platform_manage/process/processApproval",
+    query: {
+      flowKey: "erp_coding_group_flow",
+      flowName: "ERP编码组合发起流程",
+      random: proxy.random(),
+    },
+  });
+};
+const clickBalance = () => {
+  if (
+    formData.data.accountRemainderList &&
+    formData.data.accountRemainderList.length > 0
+  ) {
+    formData.data.accountRemainderList.push({
+      currency: "",
+      remainder: undefined,
+    });
+  } else {
+    formData.data.accountRemainderList = [
+      { currency: "", remainder: undefined },
+    ];
+  }
+};
+const handleRemove = (index) => {
+  formData.data.accountRemainderList.splice(index, 1);
+};
+const isRepeat = (arr) => {
+  var hash = {};
+  for (var i in arr) {
+    if (hash[arr[i].currency]) return true;
+    hash[arr[i].currency] = true;
+  }
+  return false;
+};
+const submitForm = () => {
+  submit.value.handleSubmit(() => {
+    loadingDialog.value = true;
+    proxy.post("/contractor/" + modalType.value, formData.data).then(
+      () => {
+        proxy.msgTip("操作成功", 1);
+        dialogVisible.value = false;
+        getList();
+      },
+      (err) => {
+        console.log(err);
+        loadingDialog.value = false;
+      }
+    );
+    // if (
+    //   formData.data.accountRemainderList &&
+    //   formData.data.accountRemainderList.length > 0
+    // ) {
+    //   if (isRepeat(formData.data.accountRemainderList)) {
+    //     return ElMessage("请勿重复添加货币余额");
+    //   } else {
+    //     loadingDialog.value = true;
+    //     proxy.post("/accountManagement/" + modalType.value, formData.data).then(
+    //       () => {
+    //         ElMessage({
+    //           message: modalType.value == "add" ? "添加成功" : "编辑成功",
+    //           type: "success",
+    //         });
+    //         dialogVisible.value = false;
+    //         getList();
+    //       },
+    //       (err) => {
+    //         console.log(err);
+    //         loadingDialog.value = false;
+    //       }
+    //     );
+    //   }
+    // } else {
+    //   return ElMessage("请添加至少一条类型余额");
+    // }
+  });
+};
+
+const update = (row) => {
+  loadingDialog.value = false;
+  modalType.value = "edit";
+  formData.data = proxy.deepClone(row);
+  dialogVisible.value = true;
+};
+
+const clickUpdate = (row) => {
+  proxy.$router.push({
+    path: "/platform_manage/process/processApproval",
+    query: {
+      flowKey: "erp_coding_group_flow",
+      flowName: "ERP编码组合发起流程",
+      random: proxy.random(),
+      businessId: row.id,
+    },
+  });
+};
+
+const getDtl = (row) => {
+  proxy.$router.push({
+    path: "/platform_manage/process/processApproval",
+    query: {
+      flowKey: "erp_coding_group_flow",
+      flowName: "ERP编码组合流程查看",
+      random: proxy.random(),
+      businessId: row.id,
+      processType: 20,
+    },
+  });
+};
+
+// onMounted(() => {
+//   $bus.on("refreshTableData", () => {
+//     getList();
+//   });
+// });
+
+// onBeforeUnmount(() => {
+//   // 取消订阅特定事件
+//   $bus.off("refreshTableData");
+// });
+useRefreshTableData(getList);
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+</style>

+ 12 - 1
src/views/oa/application/medicalAndsocialSecurity/index.vue

@@ -34,7 +34,7 @@ import { computed, ref } from "vue";
 import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import useUserStore from "@/store/modules/user";
-import { ElMessage, ElMessageBox } from "element-plus";
+import $bus from "@/bus/index.js";
 
 const { proxy } = getCurrentInstance();
 const sealType = computed(() => proxy.useUserStore().allDict["seal_type"]);
@@ -490,6 +490,17 @@ const getDtl = (row) => {
     },
   });
 };
+
+onMounted(() => {
+  $bus.on("refreshTableData", () => {
+    getList();
+  });
+});
+
+onBeforeUnmount(() => {
+  // 取消订阅特定事件
+  $bus.off("refreshTableData");
+});
 </script>
 
 <style lang="scss" scoped>

+ 12 - 17
src/views/oa/application/sealManage/index.vue

@@ -74,19 +74,19 @@ const config = computed(() => {
     {
       attrs: {
         label: "存管人员",
-        prop: "accountBank",
+        prop: "custodyUserName",
       },
     },
     {
       attrs: {
         label: "存管部门",
-        prop: "accountName",
+        prop: "custodyDeptName",
       },
     },
     {
       attrs: {
         label: "印章用途",
-        prop: "印章用途",
+        prop: "remark",
       },
     },
     {
@@ -120,7 +120,7 @@ const config = computed(() => {
                 .msgConfirm()
                 .then((res) => {
                   proxy
-                    .post("/contractor/delete", {
+                    .post("/sealConfig/delete", {
                       id: row.id,
                     })
                     .then((res) => {
@@ -140,7 +140,7 @@ const corporationList = ref([]);
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/contractor/page", sourceList.value.pagination).then((res) => {
+  proxy.post("/sealConfig/page", sourceList.value.pagination).then((res) => {
     sourceList.value.data = res.rows;
     sourceList.value.pagination.total = res.total;
     setTimeout(() => {
@@ -207,14 +207,14 @@ const formConfig = computed(() => {
     },
     {
       type: "select",
-      prop: "sealType",
+      prop: "type",
       label: "印章类型",
       data: sealType.value,
       itemWidth: 50,
     },
     {
       type: "select",
-      prop: "applyUserId",
+      prop: "custodyUserId",
       label: "存管人员",
       required: true,
       filterable: true,
@@ -222,15 +222,14 @@ const formConfig = computed(() => {
       itemWidth: 50,
       fn: (val) => {
         let current = userList.value.find((x) => x.value == val);
-        console.log(current, "ada");
         if (current) {
-          formData.data.deptId = current.deptId;
+          formData.data.custodyDeptId = current.deptId;
         }
       },
     },
     {
       type: "treeSelect",
-      prop: "deptId",
+      prop: "custodyDeptId",
       label: "存管部门",
       data: deptData.value,
       propsTreeLabel: "deptName",
@@ -240,7 +239,7 @@ const formConfig = computed(() => {
     },
     {
       type: "input",
-      prop: "accountNumber",
+      prop: "remark",
       label: "印章用途",
       itemWidth: 100,
       itemType: "textarea",
@@ -248,11 +247,7 @@ const formConfig = computed(() => {
   ];
 });
 const rules = ref({
-  name: [{ required: true, message: "请输入承包商", trigger: "blur" }],
-  taxPoints: [{ required: true, message: "请输入税点", trigger: "blur" }],
-  accountBank: [{ required: true, message: "请输入开户行", trigger: "blur" }],
-  accountName: [{ required: true, message: "请输入开户名", trigger: "blur" }],
-  accountNumber: [{ required: true, message: "请输入账号", trigger: "blur" }],
+  name: [{ required: true, message: "请输入印章名称", trigger: "blur" }],
 });
 const formData = reactive({
   data: {
@@ -296,7 +291,7 @@ const isRepeat = (arr) => {
 const submitForm = () => {
   submit.value.handleSubmit(() => {
     loadingDialog.value = true;
-    proxy.post("/contractor/" + modalType.value, formData.data).then(
+    proxy.post("/sealConfig/" + modalType.value, formData.data).then(
       () => {
         proxy.msgTip("操作成功", 1);
         dialogVisible.value = false;

+ 576 - 0
src/views/oa/application/useSeal/index.vue

@@ -0,0 +1,576 @@
+<template>
+  <div class="pageIndexClass">
+    <div class="content">
+      <byTable :source="sourceList.data" :pagination="sourceList.pagination" :selectConfig="selectConfig" :config="config" :loading="loading"
+               highlight-current-row :action-list="[
+          {
+            text: '添加',
+            action: () => openModal('add'),
+          },
+        ]" @get-list="getList">
+
+        <template #code="{item}">
+          <div style="width:100%">
+            <span class="el-click" @click="getDtl(item)">{{item.code}}</span>
+          </div>
+        </template>
+      </byTable>
+    </div>
+
+    <el-dialog :title="modalType == 'add' ? '归还' : '编辑'" v-if="dialogVisible" v-model="dialogVisible" width="500">
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit" v-loading="loadingDialog">
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="default">取 消</el-button>
+        <el-button type="primary" @click="submitForm()" size="default">确 定</el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import { computed, ref } from "vue";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import useUserStore from "@/store/modules/user";
+import moment from "moment";
+import $bus from "@/bus/index.js";
+
+const { proxy } = getCurrentInstance();
+const sealType = computed(() => proxy.useUserStore().allDict["seal_type"]);
+const sealCategory = computed(
+  () => proxy.useUserStore().allDict["seal_category"]
+);
+const sealIsContract = computed(
+  () => proxy.useUserStore().allDict["seal_is_contract"]
+);
+const userList = ref([]);
+const deptData = ref([]);
+const typeData = ref([
+  {
+    label: "收入",
+    value: "10",
+  },
+  {
+    label: "支出",
+    value: "20",
+  },
+]);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+  },
+});
+const loading = ref(false);
+const statusData = ref([
+  {
+    label: "草稿",
+    value: 0,
+  },
+  {
+    label: "审批中",
+    value: 10,
+  },
+  {
+    label: "审批驳回",
+    value: 20,
+  },
+  {
+    label: "审批通过",
+    value: 30,
+  },
+  {
+    label: "作废",
+    value: 88,
+  },
+]);
+const isReturnedData = ref([
+  {
+    label: "是",
+    value: 1,
+  },
+  {
+    label: "否",
+    value: 0,
+  },
+]);
+
+const useMethodData = ref([
+  {
+    dictValue: "借章",
+    dictKey: "1",
+  },
+  {
+    dictValue: "盖章",
+    dictKey: "2",
+  },
+]);
+const selectConfig = computed(() => {
+  return [
+    {
+      label: "审批状态",
+      prop: "status",
+      data: statusData.value,
+    },
+    {
+      label: "是否归还",
+      prop: "isReturned",
+      data: isReturnedData.value,
+    },
+    // {
+    //   label: "使用方式",
+    //   prop: "useMethod",
+    //   data: useMethodData.value,
+    // },
+    // {
+    //   label: "印章类型",
+    //   prop: "sealType",
+    //   data: sealType.value,
+    // },
+    // {
+    //   label: "盖章类别",
+    //   prop: "stampedType",
+    //   data: sealCategory.value,
+    // },
+  ];
+});
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "流水号",
+        slot: "code",
+        width: 130,
+        fixed: "left",
+      },
+    },
+
+    {
+      attrs: {
+        label: "申请人",
+        prop: "createUserName",
+        width: 130,
+      },
+    },
+    {
+      attrs: {
+        label: "申请日期",
+        prop: "applyTime",
+        width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "使用方式",
+        prop: "useMethod",
+        width: 90,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, useMethodData.value);
+      },
+    },
+    {
+      attrs: {
+        label: "印章类型",
+        prop: "sealType",
+        width: 90,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, sealType.value);
+      },
+    },
+    {
+      attrs: {
+        label: "盖章类别",
+        prop: "stampedType",
+        width: 100,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, sealCategory.value);
+      },
+    },
+    {
+      attrs: {
+        label: "是否销售合同",
+        prop: "isContract",
+        width: 110,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, sealIsContract.value);
+      },
+    },
+    {
+      attrs: {
+        label: "销售合同单号",
+        prop: "contractCode",
+        width: 150,
+      },
+    },
+    {
+      attrs: {
+        label: "借出日期",
+        prop: "borrowTime",
+        width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "归还日期",
+        prop: "returnedTime",
+        width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "借出用途说明",
+        prop: "remark",
+        "min-width": 200,
+      },
+    },
+    {
+      attrs: {
+        label: "是否归还",
+        prop: "isReturned",
+        width: 80,
+      },
+      render(val) {
+        return proxy.dictValueLabel(val, isReturnedData.value);
+      },
+    },
+    {
+      attrs: {
+        label: "实际归还日期",
+        prop: "realityReturnedTime",
+        width: 110,
+      },
+    },
+    {
+      attrs: {
+        label: "审批状态",
+        prop: "status",
+        width: 100,
+        fixed: "right",
+      },
+      render(type) {
+        return proxy.dictValueLabel(type, statusData.value);
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "120",
+        align: "center",
+        fixed: "right",
+      },
+      renderHTML(row) {
+        return [
+          row.status == 30 && row.useMethod == 1 && row.isReturned == 0
+            ? {
+                attrs: {
+                  label: "归还",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  handleReturn(row);
+                },
+              }
+            : {},
+          row.status == 0
+            ? {
+                attrs: {
+                  label: "修改",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  clickUpdate(row);
+                },
+              }
+            : {},
+          row.status == 0
+            ? {
+                attrs: {
+                  label: "删除",
+                  type: "danger",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  proxy
+                    .msgConfirm()
+                    .then((res) => {
+                      proxy
+                        .post("/sealUse/delete", {
+                          id: row.id,
+                        })
+                        .then((res) => {
+                          proxy.msgTip("操作成功", 1);
+                          getList();
+                        });
+                    })
+                    .catch((err) => {});
+                },
+              }
+            : {},
+          row.status == 10 || row.status == 30
+            ? {
+                attrs: {
+                  label: "作废",
+                  type: "danger",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  proxy
+                    .msgConfirm()
+                    .then((res) => {
+                      proxy
+                        .post("/sealUse/cancellation", {
+                          id: row.id,
+                        })
+                        .then((res) => {
+                          proxy.msgTip("操作成功", 1);
+                          getList();
+                        });
+                    })
+                    .catch((err) => {});
+                },
+              }
+            : {},
+        ];
+      },
+    },
+  ];
+});
+const corporationList = ref([]);
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/sealUse/page", sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+getList();
+const getDeptData = (val) => {
+  proxy
+    .get("/tenantUser/list", {
+      pageNum: 1,
+      pageSize: 10000,
+      tenantId: proxy.useUserStore().user.tenantId,
+      companyId: proxy.useUserStore().user.companyId,
+    })
+    .then((res) => {
+      userList.value = res.rows.map((item) => {
+        return {
+          ...item,
+          label: item.nickName,
+          value: item.userId,
+        };
+      });
+    });
+
+  proxy
+    .get("/tenantDept/list", {
+      pageNum: 1,
+      pageSize: 9999,
+      keyword: "",
+      ancestors: proxy.useUserStore().user.companyId,
+      tenantId: proxy.useUserStore().user.tenantId,
+      // type: 2,
+    })
+    .then((res) => {
+      deptData.value = proxy.handleTree(res.data, "deptId");
+    });
+};
+getDeptData();
+const modalType = ref("add");
+const dialogVisible = ref(false);
+const loadingDialog = ref(false);
+const submit = ref(null);
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const formConfig = computed(() => {
+  return [
+    {
+      type: "date",
+      prop: "realityReturnedTime",
+      itemType: "date",
+      label: "归还日期",
+      itemWidth: 100,
+      disabled: false,
+    },
+  ];
+});
+const rules = ref({
+  realityReturnedTime: [
+    { required: true, message: "请选择归还日期", trigger: "change" },
+  ],
+});
+const formData = reactive({
+  data: {
+    accountRemainderList: [{ currency: "", remainder: undefined }],
+  },
+});
+const openModal = (val) => {
+  // modalType.value = val;
+  // formData.data = {
+  //   accountRemainderList: [{ currency: "", remainder: undefined }],
+  // };
+  // loadingDialog.value = false;
+  // dialogVisible.value = true;
+  proxy.$router.replace({
+    path: "/platform_manage/process/processApproval",
+    query: {
+      flowKey: "seal_use_flow",
+      flowName: "用印申请发起流程",
+      random: proxy.random(),
+    },
+  });
+};
+const clickBalance = () => {
+  if (
+    formData.data.accountRemainderList &&
+    formData.data.accountRemainderList.length > 0
+  ) {
+    formData.data.accountRemainderList.push({
+      currency: "",
+      remainder: undefined,
+    });
+  } else {
+    formData.data.accountRemainderList = [
+      { currency: "", remainder: undefined },
+    ];
+  }
+};
+const handleRemove = (index) => {
+  formData.data.accountRemainderList.splice(index, 1);
+};
+const isRepeat = (arr) => {
+  var hash = {};
+  for (var i in arr) {
+    if (hash[arr[i].currency]) return true;
+    hash[arr[i].currency] = true;
+  }
+  return false;
+};
+
+const submitForm = () => {
+  submit.value.handleSubmit(() => {
+    loadingDialog.value = true;
+    proxy.post("/sealUse/returned", formData.data).then(
+      () => {
+        proxy.msgTip("操作成功", 1);
+        dialogVisible.value = false;
+        loadingDialog.value = false;
+        getList();
+      },
+      (err) => {
+        console.log(err);
+        loadingDialog.value = false;
+      }
+    );
+    // if (
+    //   formData.data.accountRemainderList &&
+    //   formData.data.accountRemainderList.length > 0
+    // ) {
+    //   if (isRepeat(formData.data.accountRemainderList)) {
+    //     return ElMessage("请勿重复添加货币余额");
+    //   } else {
+    //     loadingDialog.value = true;
+    //     proxy.post("/accountManagement/" + modalType.value, formData.data).then(
+    //       () => {
+    //         ElMessage({
+    //           message: modalType.value == "add" ? "添加成功" : "编辑成功",
+    //           type: "success",
+    //         });
+    //         dialogVisible.value = false;
+    //         getList();
+    //       },
+    //       (err) => {
+    //         console.log(err);
+    //         loadingDialog.value = false;
+    //       }
+    //     );
+    //   }
+    // } else {
+    //   return ElMessage("请添加至少一条类型余额");
+    // }
+  });
+};
+
+const update = (row) => {
+  loadingDialog.value = false;
+  modalType.value = "edit";
+  formData.data = proxy.deepClone(row);
+  dialogVisible.value = true;
+};
+
+const clickUpdate = (row) => {
+  proxy.$router.push({
+    path: "/platform_manage/process/processApproval",
+    query: {
+      flowKey: "seal_use_flow",
+      flowName: "用印申请发起流程",
+      random: proxy.random(),
+      businessId: row.id,
+    },
+  });
+};
+
+const getDtl = (row) => {
+  proxy.$router.push({
+    path: "/platform_manage/process/processApproval",
+    query: {
+      flowKey: "seal_use_flow",
+      flowName: "用印申请流程查看",
+      random: proxy.random(),
+      businessId: row.id,
+      processType: 20,
+    },
+  });
+};
+
+const handleReturn = (row) => {
+  modalType.value = "add";
+  formData.data = {
+    id: row.id,
+    realityReturnedTime: moment().format("YYYY-HH-MM"),
+  };
+  dialogVisible.value = true;
+};
+
+onMounted(() => {
+  $bus.on("refreshTableData", () => {
+    getList();
+  });
+});
+
+onBeforeUnmount(() => {
+  // 取消订阅特定事件
+  $bus.off("refreshTableData");
+});
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+</style>

+ 28 - 0
src/views/process/processApproval/index.vue

@@ -58,6 +58,10 @@
         <MedicalAndsocialSecurity ref="makeDom" v-else-if="flowForm.flowKey == 'medical_insurance_flow'" :queryData="queryData.data">
         </MedicalAndsocialSecurity>
 
+        <UseSeal ref="makeDom" v-else-if="flowForm.flowKey == 'seal_use_flow'" :queryData="queryData.data"></UseSeal>
+
+        <EncodingCombination ref="makeDom" v-else-if="flowForm.flowKey == 'erp_coding_group_flow'" :queryData="queryData.data"></EncodingCombination>
+
         <!-- 取消到账认领 -->
         <!-- <CancelClaim ref="makeDom" v-else-if="flowForm.flowKey == 'claim_del_flow'" :queryData="queryData.data"></CancelClaim> -->
       </div>
@@ -217,6 +221,8 @@ import PurchaseChange from "@/components/process/SF/PurchaseChange";
 import ReturnGood from "@/components/process/SF/ReturnGood";
 import EducationSubsidy from "@/components/process/SF/EducationSubsidy";
 import MedicalAndsocialSecurity from "@/components/process/SF/MedicalAndsocialSecurity";
+import UseSeal from "@/components/process/SF/UseSeal";
+import EncodingCombination from "@/components/process/SF/EncodingCombination";
 
 import PurchasePayment from "@/components/process/PurchasePayment";
 import SendFunds from "@/components/process/SendFunds";
@@ -243,6 +249,8 @@ const StagFlowKey = ref([
   "cost_control_flow",
   "education_subsidy_flow",
   "medical_insurance_flow",
+  "seal_use_flow",
+  "erp_coding_group_flow",
 ]);
 // tab切换逻辑
 const activeName = ref("first");
@@ -457,6 +465,24 @@ const handleSubmitStag = async (_type) => {
                 btnLoading.value = false;
               }
             );
+          } else if (flowForm.flowKey == "seal_use_flow") {
+            proxy.post("/sealUse/add", data).then(
+              (res) => {
+                skipPage();
+              },
+              (err) => {
+                btnLoading.value = false;
+              }
+            );
+          } else if (flowForm.flowKey == "erp_coding_group_flow") {
+            proxy.post("/erpCodingGroup/add", data).then(
+              (res) => {
+                skipPage();
+              },
+              (err) => {
+                btnLoading.value = false;
+              }
+            );
           }
         }
       });
@@ -484,6 +510,8 @@ const skipPage = () => {
     cost_control_flow: "CostControl",
     education_subsidy_flow: "EducationSubsidy",
     medical_insurance_flow: "MedicalAndsocialSecurity",
+    seal_use_flow: "UseSeal",
+    erp_coding_group_flow: "EncodingCombination",
   };
   const useTagsStore = useTagsViewStore();
   useTagsStore.delVisitedView(router.currentRoute.value);