瀏覽代碼

采购付款新需求

cz 1 年之前
父節點
當前提交
b71c020f3c

+ 8 - 2
src/views/WDLY/outInBound/abnormal/index.vue

@@ -79,7 +79,10 @@
                   处理方式:
                   {{ dictValueLabel(activity.processing, handleMethon) }}
                 </div>
-                <div style="margin-top: 5px">
+                <div
+                  style="margin-top: 5px"
+                  v-if="!rolesList.includes('storekeeper')"
+                >
                   跟进记录: {{ activity.explain }}
                 </div>
               </el-timeline-item>
@@ -231,7 +234,10 @@ import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import { computed, defineComponent, ref } from "vue";
 import useUserStore from "@/store/modules/user";
-
+const rolesList = ref([]);
+if (useUserStore().user.roles && useUserStore().user.roles.length > 0) {
+  rolesList.value = useUserStore().user.roles.map((x) => x.roleKey);
+}
 const loading = ref(false);
 const submitLoading = ref(false);
 const sourceList = ref({

+ 153 - 2
src/views/WDLY/purchaseManage/payment/index.vue

@@ -44,6 +44,13 @@
           <div>
             <el-button
               type="primary"
+              v-if="item.payStatus != 0"
+              link
+              @click="handleRefund(item)"
+              >退款</el-button
+            >
+            <el-button
+              type="primary"
               link
               v-if="item.payStatus != 30"
               @click="handlePayment(10, item)"
@@ -102,6 +109,21 @@
                   </el-form-item>
                 </template>
               </el-table-column>
+              <el-table-column prop="remark" label="备注" min-width="150">
+                <template #default="{ row, $index }">
+                  <el-form-item
+                    :prop="'purchasePayRecordDetailList.' + $index + '.remark'"
+                    :rules="rules.remark"
+                    :inline-message="true"
+                  >
+                    <el-input
+                      v-model="row.remark"
+                      placeholder="请输入"
+                      type="textarea"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
             </el-table>
           </div>
         </template>
@@ -118,6 +140,35 @@
         </el-button>
       </template>
     </el-dialog>
+    <el-dialog
+      :title="'退款'"
+      v-model="dialogVisibleTwo"
+      width="800"
+      v-loading="submitLoading"
+      destroy-on-close
+    >
+      <byForm
+        :formConfig="formConfigOne"
+        :formOption="formOption"
+        v-model="formData.dataOne"
+        :rules="rulesOne"
+        ref="byformOne"
+      >
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisibleTwo = false" size="large"
+          >取 消</el-button
+        >
+        <el-button
+          type="primary"
+          @click="submitFormOne()"
+          size="large"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
 
     <el-dialog
       v-model="dialogVisibleOne"
@@ -141,6 +192,7 @@
               付款金额:{{ moneyFormat(activity.amount, 2) }}
             </div>
             <div style="margin-top: 5px">付款时间: {{ activity.payDate }}</div>
+            <div style="margin-top: 5px">付款备注: {{ activity.remark }}</div>
           </el-timeline-item>
         </el-timeline>
       </div>
@@ -166,6 +218,7 @@ const sourceList = ref({
     pageSize: 10,
     type: "",
     keyword: "",
+    purchaseStatus: "30,99",
   },
 });
 let dialogVisible = ref(false);
@@ -179,6 +232,13 @@ let rules = ref({
     { required: true, message: "请选择付款账号", trigger: "change" },
   ],
 });
+let rulesOne = ref({
+  amount: [{ required: true, message: "请输入退款金额", trigger: "blur" }],
+  refundDate: [
+    { required: true, message: "请选择退款时间", trigger: "change" },
+  ],
+  // remark: [{ required: true, message: "请输入备注", trigger: "blur" }],
+});
 const { proxy } = getCurrentInstance();
 const arrivalStatus = ref([
   {
@@ -278,6 +338,16 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "退款金额",
+        prop: "refundAmount",
+        width: 100,
+      },
+      render(refundAmount) {
+        return proxy.moneyFormat(refundAmount, 2);
+      },
+    },
+    {
+      attrs: {
         label: "采购人",
         prop: "purchaseName",
         width: 150,
@@ -311,7 +381,7 @@ const config = computed(() => {
       attrs: {
         label: "操作",
         slot: "btn",
-        width: "180",
+        width: "200",
         align: "center",
         fixed: "right",
       },
@@ -323,6 +393,7 @@ let formData = reactive({
   data: {
     type: "1",
   },
+  dataOne: {},
 });
 const formOption = reactive({
   inline: true,
@@ -331,7 +402,6 @@ const formOption = reactive({
   rules: [],
 });
 const byform = ref(null);
-
 let formConfig = computed(() => [
   {
     type: "input",
@@ -364,6 +434,13 @@ let formConfig = computed(() => [
     disabled: true,
   },
   {
+    type: "input",
+    itemType: "textarea",
+    prop: "remark",
+    label: "备注",
+    disabled: false,
+  },
+  {
     type: "title",
     title: "付款明细",
   },
@@ -373,6 +450,47 @@ let formConfig = computed(() => [
     label: "",
   },
 ]);
+const dialogVisibleTwo = ref(false);
+const byformOne = ref(null);
+let formConfigOne = computed(() => [
+  {
+    type: "input",
+    prop: "supplyName",
+    label: "供应商",
+    disabled: true,
+  },
+  {
+    type: "input",
+    prop: "contractCode",
+    label: "采购单号",
+    disabled: true,
+    itemWidth: 34,
+  },
+  {
+    type: "date",
+    itemType: "datetime",
+    prop: "refundDate",
+    label: "退款时间",
+    format: "YYYY-MM-DD HH:mm:ss",
+    itemWidth: 100,
+  },
+  {
+    type: "number",
+    prop: "amount",
+    label: "退款金额",
+    precision: 4,
+    min: 1,
+    controls: false,
+    // disabled: true,
+  },
+  {
+    type: "input",
+    itemType: "textarea",
+    prop: "remark",
+    label: "备注",
+    disabled: false,
+  },
+]);
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
@@ -425,6 +543,26 @@ const submitForm = () => {
     );
   });
 };
+
+const submitFormOne = () => {
+  byformOne.value.handleSubmit((valid) => {
+    submitLoading.value = true;
+    proxy.post("/purchaseRefundRecord/add", formData.dataOne).then(
+      (res) => {
+        ElMessage({
+          message: "操作成功",
+          type: "success",
+        });
+        dialogVisibleTwo.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      (err) => {
+        submitLoading.value = false;
+      }
+    );
+  });
+};
 const selectData = ref([]);
 const selectRow = (data) => {
   selectData.value = data;
@@ -465,11 +603,24 @@ const handlePayment = (type, data) => {
       waitAmount: x.amount,
       alreadyAmount: x.paidAmount,
       amount: null,
+      remark: "",
     })),
   };
   dialogVisible.value = true;
 };
 
+const handleRefund = (row) => {
+  formData.dataOne = {
+    purchaseId: row.id,
+    supplyName: row.supplyName,
+    contractCode: row.contractCode,
+    amount: "",
+    refundDate: "",
+    remark: "",
+  };
+  dialogVisibleTwo.value = true;
+};
+
 const handleClickPayStatus = (row) => {
   proxy
     .post("/purchasePayRecordDetail/page", { purchaseId: row.id })

+ 1 - 1
src/views/process/processApproval/index.vue

@@ -273,7 +273,7 @@ const handleSubmit = async (_type) => {
       flowFormDom.value.validate((valid) => {
         if (valid) {
           // const data = { ...makeDom.value.submitData };
-          const data = makeDom.value.getFormData();
+          const data = { ...makeDom.value.getFormData() };
           if (flowForm.flowKey == "subscribe_flow") {
             data.subscribeDetailList = data.subscribeDetailList.map((x) => ({
               bussinessId: x.bussinessId,

+ 66 - 0
src/views/process/processConfig/branchBtn.vue

@@ -0,0 +1,66 @@
+<template>
+  <div class="branch-btn">
+    <div class="icon-box">
+      <div class="icon">
+        <i class="iconfont icon-iconm_fenz"></i>
+      </div>
+      <div class="icon-text">分支</div>
+    </div>
+    <div class="title">{{ title || "待配置" }}</div>
+  </div>
+</template>
+<script setup>
+import { defineProps, inject, ref } from "vue";
+let title = ref("");
+let getNode = inject("getNode");
+const node = getNode();
+node.on("change:data", ({ current }) => {
+  title.value = current.title;
+});
+</script>
+<style lang="scss">
+.branch-btn {
+  height: 90px;
+  width: 150px;
+  background: #fff;
+  text-align: center;
+  box-shadow: 0px 2px 10px 1px rgba(51, 51, 51, 0.1);
+  border-radius: 10px 10px 10px 10px;
+  padding: 10px;
+  .title {
+    width: 100%;
+    height: 40px;
+    line-height: 40px;
+    padding: 0 20px;
+    text-align: left;
+    background: #eee;
+    border-radius: 10px;
+    margin-top: 10px;
+    //文字一行多余省略
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+  }
+  .icon-box {
+    display: flex;
+    height: 20px;
+    line-height: 20px;
+    color: #333;
+    font-size: 14px;
+    .icon {
+      height: 20px;
+      width: 20px;
+      border-radius: 10px;
+      background: #7566f0;
+      color: #fff;
+      i {
+        color: #fff;
+        font-size: 12px;
+      }
+    }
+    .icon-text {
+      margin-left: 10px;
+    }
+  }
+}
+</style>

+ 44 - 9
src/views/process/processConfig/vueFlow.vue

@@ -13,7 +13,7 @@
 		v-loading="loading"
 	>
 		<byForm
-			:formConfig="formConfig"
+			:formConfig="formType === 'handle-btn' ? formConfig : branchBtnConfig"
 			:formOption="formOption"
 			v-model="formData.data"
 			:rules="rules"
@@ -95,8 +95,10 @@ import { ElMessage, ElMessageBox } from "element-plus";
 import startBtn from "./startBtn.vue";
 import endBtn from "./endBtn.vue";
 import handleBtn from "./handleBtn.vue";
+import branchBtn from "./branchBtn.vue";
 import { MiniMap } from "@antv/x6-plugin-minimap";
 import useTagsViewStore from "@/store/modules/tagsView";
+import { rectToBox } from "@vue-flow/core/dist/utils/graph";
 
 defineProps({
   title: {
@@ -110,6 +112,7 @@ const dialogVisible = ref(false);
 const modalType = ref("add");
 const loading = ref(false);
 const submitLoading = ref(false);
+let formType = ref(1); //1办理 2分支
 const formData = reactive({
   data: {
     userName: "",
@@ -143,6 +146,17 @@ const rules = reactive({
     },
   ],
 });
+const branchBtnConfig = computed(() => {
+  return [
+    {
+      type: "input",
+      prop: "nodeName",
+      label: "节点名称",
+      required: true,
+      itemType: "text",
+    },
+  ];
+});
 const formConfig = computed(() => {
   return [
     {
@@ -152,7 +166,6 @@ const formConfig = computed(() => {
       required: true,
       itemType: "text",
     },
-
     {
       type: "select",
       prop: "handleObjectType",
@@ -295,6 +308,7 @@ const submitAll = () => {
   const nodeList = graph.toJSON().cells;
   submitFormData.nodeObject = JSON.stringify(nodeList);
   submitFormData.lineObject = JSON.stringify(flowDefinitionNodeObj.value);
+  console.log(nodeList);
   const isStart = false;
   for (let i = 0; i < nodeList.length; i++) {
     const element = nodeList[i];
@@ -313,7 +327,7 @@ const submitAll = () => {
       }
       submitFormData.flowDefinitionNodeList.push({
         ...flowDefinitionNodeObj.value[element.id],
-        nodeType: 2,
+        nodeType: element.shape == "branch-btn" ? 3 : 2,
       });
     }
     if (element.shape == "end-btn") {
@@ -571,7 +585,7 @@ const antvInit = (data) => {
     title: "流程图",
     target: graph,
     stencilGraphWidth: 360,
-    stencilGraphHeight: 180,
+    stencilGraphHeight: 280,
     collapsable: true,
     groups: [
       {
@@ -661,7 +675,7 @@ const antvInit = (data) => {
       });
       return;
     }
-
+    formType.value = cell.shape;
     if (flowDefinitionNodeObj.value[cell.id]) {
       formData.data = flowDefinitionNodeObj.value[cell.id];
       formData.data.cell = cell;
@@ -795,6 +809,14 @@ const antvInit = (data) => {
     ports: { ...ports },
   });
   register({
+    shape: "branch-btn",
+    width: 150,
+    height: 90,
+    effect: ["title"],
+    component: branchBtn,
+    ports: { ...ports },
+  });
+  register({
     shape: "end-btn",
     width: 150,
     height: 90,
@@ -829,6 +851,17 @@ const antvInit = (data) => {
     },
   });
   const r3 = graph.createNode({
+    shape: "branch-btn",
+    label: "分支",
+    zIndex: 100,
+    attrs: {
+      body: {
+        rx: 40,
+        ry: 46,
+      },
+    },
+  });
+  const r4 = graph.createNode({
     shape: "end-btn",
     label: "结束",
     zIndex: 100,
@@ -839,7 +872,7 @@ const antvInit = (data) => {
       },
     },
   });
-  stencil.load([r2, r3], "group1");
+  stencil.load([r2, r3, r4], "group1");
   // const startNode = graph.addNode({
   // 	shape: 'custom-rect',
   // 	label: '开始',
@@ -880,11 +913,13 @@ const getFlowInfo = () => {
       } else {
         antvInit();
       }
-      console.log(flowDefinitionNodeObj.value);
       for (const key in flowDefinitionNodeObj.value) {
         //延迟等待dom渲染完成
         setTimeout(() => {
-          if (flowDefinitionNodeObj.value[key].nodeName != "结束") {
+          if (
+            flowDefinitionNodeObj.value[key].nodeName != "结束" &&
+            flowDefinitionNodeObj.value[key].cell != "开始"
+          ) {
             let htmlNode = document.querySelector(
               "g[data-cell-id='" + key + "']"
             );
@@ -892,7 +927,7 @@ const getFlowInfo = () => {
             htmlNode.getElementsByClassName("title")[0].innerHTML =
               flowDefinitionNodeObj.value[key].nodeName;
           }
-        }, 1000);
+        }, 2000);
       }
       dialogVisible.value = false;
     });