cz 1 tahun lalu
induk
melakukan
697a03d039

+ 372 - 0
src/components/contractCom/selectPurchase.vue

@@ -0,0 +1,372 @@
+<template>
+  <div class="tenant">
+    <byTable
+      :source="sourceList.data"
+      :pagination="sourceList.pagination"
+      :config="config"
+      :loading="loading"
+      :selectConfig="selectConfig"
+      :row-class-name="getRowClass"
+      highlight-current-row
+      @get-list="getList"
+    >
+      <template #code="{ item }">
+        <div
+          v-if="Number(item.sumPayMoney) > Number(item.amount)"
+          style="cursor: pointer; color: #f54a45"
+          @click="handleClickCode(item)"
+        >
+          {{ item.code }}
+        </div>
+        <div
+          v-else
+          style="cursor: pointer; color: #409eff"
+          @click="handleClickCode(item)"
+        >
+          {{ item.code }}
+        </div>
+      </template>
+      <template #amount="{ item }">
+        <div>
+          <span style="padding-right: 4px">{{ item.currency }}</span>
+          <span>{{ moneyFormat(item.amount, 2) }}</span>
+        </div>
+      </template>
+      <template #sumPayMoney="{ item }">
+        <div>
+          <span style="padding-right: 4px">{{ item.currency }}</span>
+          <span>{{ moneyFormat(item.sumPayMoney, 2) }}</span>
+        </div>
+      </template>
+    </byTable>
+    <el-dialog title="打印" v-if="openPdf" v-model="openPdf" width="900px">
+      <!-- <PurchasePDFOne :rowData="rowData"></PurchasePDFOne> -->
+      <PurchasePDFOneNew :rowData="rowData" ref="PdfDom"></PurchasePDFOneNew>
+      <template #footer ref="printBtn">
+        <el-button @click="openPdf = false" size="large">关闭</el-button>
+        <el-button type="primary" v-print="printObj" size="large"
+          >打印</el-button
+        >
+        <el-button type="primary" @click="clickDownload()" size="large"
+          >下载PDF</el-button
+        >
+        <el-button type="primary" @click="exportExcel()" size="large"
+          >导出Excel</el-button
+        >
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import { computed, ref } from "vue";
+import byTable from "@/components/byTable/index";
+import { ElMessage, ElMessageBox } from "element-plus";
+import PurchasePDFOne from "@/components/PDF/purchasePDFOne.vue";
+import PurchasePDFOneNew from "@/components/PDF/purchasePDFOneNew.vue";
+
+const route = useRoute();
+const { proxy } = getCurrentInstance();
+const supplierList = ref([]);
+const status = ref([
+  {
+    label: "草稿",
+    value: 0,
+  },
+  {
+    label: "审批中",
+    value: 10,
+  },
+  {
+    label: "驳回",
+    value: 20,
+  },
+  {
+    label: "已采购",
+    value: 30,
+  },
+  {
+    label: "变更中",
+    value: 60,
+  },
+  {
+    label: "已变更",
+    value: 70,
+  },
+  {
+    label: "作废",
+    value: 88,
+  },
+  {
+    label: "终止",
+    value: 99,
+  },
+]);
+const payStatus = ref([
+  {
+    label: "未付款",
+    value: 0,
+  },
+  {
+    label: "部分付款",
+    value: 10,
+  },
+  {
+    label: "已付款",
+    value: 20,
+  },
+]);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+    status: "",
+    payStatus: "",
+  },
+});
+const loading = ref(false);
+const selectConfig = computed(() => {
+  return [
+    {
+      label: "采购状态",
+      prop: "status",
+      data: status.value,
+    },
+    {
+      label: "付款状态",
+      prop: "payStatus",
+      data: payStatus.value,
+    },
+  ];
+});
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "采购单号",
+        slot: "code",
+        width: 180,
+      },
+    },
+    {
+      attrs: {
+        label: "供应商",
+        prop: "sellCorporationId",
+        "min-width": 220,
+      },
+      render(type) {
+        return proxy.dictValueLabel(type, supplierList.value);
+      },
+    },
+    {
+      attrs: {
+        label: "采购金额",
+        slot: "amount",
+        width: 140,
+      },
+    },
+    {
+      attrs: {
+        label: "已付款金额",
+        slot: "sumPayMoney",
+        width: 140,
+      },
+    },
+    {
+      attrs: {
+        label: "版本号",
+        prop: "version",
+        width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "采购人",
+        prop: "userName",
+        width: 140,
+      },
+    },
+    {
+      attrs: {
+        label: "采购时间",
+        prop: "createTime",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "采购状态",
+        prop: "status",
+        width: 140,
+      },
+      render(type) {
+        return proxy.dictValueLabel(type, status.value);
+      },
+    },
+    {
+      attrs: {
+        label: "付款状态",
+        prop: "payStatus",
+        width: 140,
+      },
+      render(type) {
+        return proxy.dictValueLabel(type, payStatus.value);
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: 80,
+        align: "center",
+        fixed: "right",
+      },
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "选择",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              clickSelect(row);
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+const getDict = () => {
+  proxy
+    .post("/supplierInfo/page", { pageNum: 1, pageSize: 999 })
+    .then((res) => {
+      supplierList.value = res.rows.map((item) => {
+        return {
+          ...item,
+          label: item.name,
+          value: item.id,
+        };
+      });
+    });
+};
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/ehsdPurchase/page", sourceList.value.pagination).then((res) => {
+    console.log(res);
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+getDict();
+if (route.query.code) {
+  sourceList.value.pagination.keyword = route.query.code;
+}
+getList();
+
+const openPdf = ref(false);
+const pdfData = ref({});
+const rowData = ref({});
+const handlePrintPdf = (row) => {
+  rowData.value = {
+    id: row.id,
+    code: row.code,
+  };
+  rowData.value = row;
+  openPdf.value = true;
+};
+const clickDownload = () => {
+  proxy.getPdf("购销合同" + rowData.value.code);
+};
+const pdfDom = ref(null);
+const printObj = ref({
+  id: "pdfDom",
+  popTitle: "",
+  extraCss:
+    "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
+  extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
+});
+
+const handleClickCode = (row) => {
+  let submitType = row.dataResource > 0 ? "10" : "20";
+  proxy.$router.push({
+    path: "/platform_manage/process/processApproval",
+    query: {
+      flowKey: row.processInstanceId,
+      id: row.flowId,
+      processType: 20,
+      businessId: row.id,
+      submitType,
+    },
+  });
+};
+
+const getRowClass = ({ row }) => {
+  if (Number(row.sumPayMoney) > Number(row.amount)) {
+    return "redClass";
+  }
+  return "";
+};
+
+const handleChange = (row) => {
+  let submitType = row.dataResource > 0 ? "10" : "20";
+  let type = "";
+  if (row.dataResource == 1) {
+    type = 1;
+  } else if (row.dataResource == 2) {
+    type = 2;
+  }
+  proxy.$router.push({
+    path: "/platform_manage/process/processApproval",
+    query: {
+      flowKey: "ehsd_purchase_update_flow",
+      flowName: "采购合同变更",
+      random: proxy.random(),
+      businessId: row.id,
+      submitType,
+      type,
+    },
+  });
+};
+
+const PdfDom = ref(null);
+const exportExcel = () => {
+  PdfDom.value.exportExcel();
+};
+
+const clickSelect = (row) => {
+  proxy.$emit("select", row.id);
+};
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+.baseRow {
+  min-height: 24px;
+  border-top: 1px solid black;
+  border-left: 1px solid black;
+}
+.contentRow {
+  border-right: 1px solid black;
+  line-height: 24px;
+  padding-left: 4px;
+}
+</style>
+<style>
+.redClass {
+  color: #f54a45 !important;
+}
+</style>

+ 146 - 0
src/components/process/EHSD/CancelClaim.vue

@@ -0,0 +1,146 @@
+<template>
+  <div style="width: 100%; padding: 0px 15px">
+    <byForm
+      :formConfig="formConfig"
+      :formOption="formOption"
+      v-model="formData.data"
+      :rules="rules"
+      ref="submit"
+    >
+      <template #details>
+        <div style="width: 50%">
+          <el-table :data="formData.data.claimRecord">
+            <el-table-column prop="contractCode" label="合同编码" />
+            <el-table-column prop="currency" label="币种" width="80" />
+            <el-table-column prop="money" label="关联金额" width="100" />
+            <el-table-column prop="claimUserName" label="认领人" width="120" />
+            <el-table-column prop="createTime" label="认领时间" width="160" />
+          </el-table>
+        </div>
+      </template>
+    </byForm>
+  </div>
+</template>
+
+<script setup>
+import byForm from "@/components/byForm/index";
+import { ElMessage } from "element-plus";
+import { useRoute } from "vue-router";
+import useUserStore from "@/store/modules/user";
+const userInfo = useUserStore();
+const route = useRoute();
+const { proxy } = getCurrentInstance();
+const formData = reactive({
+  data: {},
+});
+const submit = ref(null);
+const accountCurrency = ref([]);
+const accountList = ref([]);
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+  disabled: true,
+});
+
+const formConfig = computed(() => {
+  return [
+    {
+      type: "title",
+      title: "到账信息",
+    },
+    {
+      type: "select",
+      label: "账户名称",
+      prop: "accountManagementId",
+      data: accountList.value,
+    },
+    {
+      type: "date",
+      label: "到账时间",
+      prop: "claimTime",
+      itemType: "datetime",
+    },
+    {
+      type: "select",
+      label: "到账金额",
+      prop: "currency",
+      itemWidth: 10,
+      data: accountCurrency.value,
+    },
+    {
+      type: "number",
+      prop: "amount",
+      label: " ",
+      itemWidth: 15,
+      precision: 2,
+      min: 0,
+      controls: false,
+      style: {
+        width: "100%",
+      },
+    },
+    {
+      type: "title",
+      title: "认领明细",
+    },
+    {
+      type: "slot",
+      slotName: "details",
+    },
+  ];
+});
+const rules = ref({});
+const getDict = () => {
+  proxy.getDictOne(["account_currency"]).then((res) => {
+    accountCurrency.value = res["account_currency"].map((x) => ({
+      label: x.dictValue,
+      value: x.dictKey,
+    }));
+  });
+
+  proxy
+    .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
+    .then((res) => {
+      accountList.value = res.rows.map((item) => {
+        return {
+          ...item,
+          label: item.alias,
+          value: item.id,
+        };
+      });
+    });
+};
+getDict();
+const handleSubmit = async () => {
+  return true;
+};
+// 接收父组件的传值
+const props = defineProps({
+  queryData: Object,
+});
+const getFormData = () => {
+  return {
+    id: route.query.businessId,
+  };
+};
+// 向父组件暴露
+defineExpose({
+  getFormData,
+  handleSubmit,
+});
+onMounted(() => {
+  if (route.query && route.query.businessId) {
+    let businessId = route.query.businessId;
+    proxy.post("/claim/claimDetail", { businessId }).then((res) => {
+      formData.data = res.water;
+      formData.data.claimTime = res.water.transactionTime;
+      formData.data.claimRecord = res.claimRecord;
+    });
+  }
+});
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 115 - 0
src/components/process/EHSD/Purchase.vue

@@ -7,6 +7,18 @@
       :rules="rules"
       ref="submit"
     >
+      <template #btn>
+        <div>
+          <el-button
+            type="primary"
+            v-if="
+              [30].includes(route.query.processType) || !route.query.processType
+            "
+            @click="clickCopy"
+            >复制采购合同</el-button
+          >
+        </div>
+      </template>
       <template #buyer>
         <div style="width: 100%">
           <el-form-item prop="buyCorporationId">
@@ -786,12 +798,23 @@
         >
       </template>
     </el-dialog>
+
+    <el-dialog
+      v-if="copyContract"
+      v-model="copyContract"
+      title="采购合同选择"
+      width="90%"
+      append-to-body
+    >
+      <SelectPurchase @select="selectPurchase"></SelectPurchase>
+    </el-dialog>
   </div>
 </template>
 
 <script setup>
 import byForm from "@/components/byForm/index";
 import ProductMaterial from "@/views/product/material/index";
+import SelectPurchase from "@/components/contractCom/selectPurchase.vue";
 import { ElMessage } from "element-plus";
 import selectCity from "@/components/selectCity/index.vue";
 import Editor from "@/components/Editor/index.vue";
@@ -809,6 +832,7 @@ const countryData = ref([]);
 const provinceData = ref([]);
 const cityData = ref([]);
 const openMaterialCompany = ref(false);
+const copyContract = ref(false);
 const formData = reactive({
   data: {
     deliveryType: "1",
@@ -869,6 +893,11 @@ const formConfig = computed(() => {
   return [
     {
       type: "slot",
+      slotName: "btn",
+      label: "",
+    },
+    {
+      type: "slot",
       slotName: "buyer",
       label: "买方信息",
       itemWidth: 50,
@@ -1994,6 +2023,92 @@ const remoteMethod = (keyword) => {
   }
   return;
 };
+
+const clickCopy = () => {
+  copyContract.value = true;
+};
+const selectPurchase = (businessId) => {
+  if (businessId) {
+    proxy.post("/ehsdPurchase/detail", { id: businessId }).then((res) => {
+      res.purchaseProductList = res.ehsdPurchaseProductList || [];
+      if (!res.fileList) {
+        res.fileList = [];
+      }
+      res.countryId = res.sellCountryId;
+      res.provinceId = res.sellProvinceId;
+      res.cityId = res.sellCityId;
+      for (let key in res) {
+        if (
+          ![
+            "purchaseProductList",
+            "ehsdPurchaseProductList",
+            "purchaseArrivalList",
+          ].includes(key)
+        ) {
+          formData.data[key] = res[key];
+        }
+      }
+      remarkEditor.value.changeHtml(formData.data.remark);
+      // 回显关联销售合同
+      if (route.query && route.query.submitType === "10") {
+        getAssociationData(
+          formData.data.dataResource,
+          formData.data.dataResourceId
+        );
+      }
+      proxy
+        .post("/fileInfo/getList", {
+          businessIdList: [businessId],
+        })
+        .then((fileObj) => {
+          if (fileObj[businessId]) {
+            formData.data.fileList = fileObj[businessId]
+              .filter((x) => x.businessType === "1")
+              .map((x) => ({ raw: x, name: x.fileName, url: x.fileUrl }));
+            formData.data.packageFileList = fileObj[businessId]
+              .filter((x) => x.businessType === "2")
+              .map((x) => ({ raw: x, name: x.fileName, url: x.fileUrl }));
+          }
+        });
+      if (
+        formData.data.purchaseProductList &&
+        formData.data.purchaseProductList.length > 0
+      ) {
+        let ids = formData.data.purchaseProductList.map((x) => x.productId);
+        getAuxiliaryData(formData.data.sellCorporationId, ids);
+        proxy
+          .post("/fileInfo/getList", {
+            businessIdList: ids,
+          })
+          .then((fileObj) => {
+            for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
+              const e = formData.data.purchaseProductList[i];
+              e.activeName = true;
+              for (const key in fileObj) {
+                if (e.productId === key) {
+                  e.fileList = fileObj[key] || [];
+                  if (e.fileList && e.fileList.length > 0) {
+                    e.fileUrl = e.fileList[0].fileUrl;
+                  }
+                }
+              }
+            }
+          });
+      }
+      if (formData.data.countryId) {
+        getCityData(formData.data.countryId, "20");
+      }
+      if (formData.data.provinceId) {
+        getCityData(formData.data.provinceId, "30");
+      }
+    });
+    copyContract.value = false;
+    ElMessage({
+      message: "选择成功!",
+      type: "success",
+    });
+  }
+};
 </script>
 
 <style lang="scss" scoped>

+ 0 - 1
src/components/process/EHSD/Sample.vue

@@ -2028,7 +2028,6 @@ const selectSample = (businessId) => {
       if (res && res.dataJson) {
         res = { ...res, ...JSON.parse(res.dataJson) };
       }
-
       if (res && res.buyCorporationName) {
         proxy
           .post("/customer/selPage", { keyword: res.buyCorporationName })

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

@@ -90,6 +90,13 @@
           v-else-if="flowForm.flowKey == 'account_request_funds_flow'"
           :queryData="queryData.data"
         ></SendFunds>
+
+        <!-- 取消到账认领 -->
+        <CancelClaim
+          ref="makeDom"
+          v-else-if="flowForm.flowKey == 'claim_del_flow'"
+          :queryData="queryData.data"
+        ></CancelClaim>
       </div>
       <div class="bottom" v-if="isShowSubmitDom">
         <div class="commons-title title">处理意见</div>
@@ -249,6 +256,9 @@ import SampleChangeEHSD from "@/components/process/EHSD/SampleChange";
 import PurchaseEHSD from "@/components/process/EHSD/Purchase";
 // 采购交接单-EHSD
 import PurchaseChangeEHSD from "@/components/process/EHSD/PurchaseChange";
+// 取消认领-EHSD
+import CancelClaim from "@/components/process/EHSD/CancelClaim";
+
 //申购发起
 import SendSubscribe from "@/components/process/SendSubscribe";
 //采购发起
@@ -620,6 +630,10 @@ const skipPage = () => {
       router.replace({
         path: "/ehsd/procurement/purchased",
       });
+    } else if (flowForm.flowKey == "claim_del_flow") {
+      router.replace({
+        name: "Claim",
+      });
     }
   }
 };

+ 28 - 18
src/views/salesMange/saleContract/claim/index.vue

@@ -340,24 +340,33 @@ const config = computed(() => {
                 },
                 el: "button",
                 click() {
-                  ElMessageBox.confirm("是否确定取消认领?", "提示", {
-                    confirmButtonText: "确定",
-                    cancelButtonText: "取消",
-                    type: "warning",
-                  }).then(() => {
-                    // 删除
-                    proxy
-                      .post("/claim/delete", {
-                        id: row.id,
-                      })
-                      .then((res) => {
-                        ElMessage({
-                          message: "操作成功",
-                          type: "success",
-                        });
-                        getList();
-                      });
+                  proxy.$router.replace({
+                    path: "/platform_manage/process/processApproval",
+                    query: {
+                      flowKey: "claim_del_flow",
+                      flowName: "取消认领发起",
+                      random: proxy.random(),
+                      businessId: row.id,
+                    },
                   });
+                  // ElMessageBox.confirm("是否确定取消认领?", "提示", {
+                  //   confirmButtonText: "确定",
+                  //   cancelButtonText: "取消",
+                  //   type: "warning",
+                  // }).then(() => {
+                  //   // 删除
+                  //   proxy
+                  //     .post("/claim/delete", {
+                  //       id: row.id,
+                  //     })
+                  //     .then((res) => {
+                  //       ElMessage({
+                  //         message: "操作成功",
+                  //         type: "success",
+                  //       });
+                  //       getList();
+                  //     });
+                  // });
                 },
               }
             : {},
@@ -440,11 +449,12 @@ const formConfig = reactive([
     label: "上传附件",
   },
 ]);
+
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
   proxy
-    .post("/accountRunningWater/page", sourceList.value.pagination)
+    .post("/sale/accountRunningWater/page", sourceList.value.pagination)
     .then((message) => {
       sourceList.value.data = message.rows;
       sourceList.value.pagination.total = message.total;