Browse Source

feat:添加解除标签

snow 10 months ago
parent
commit
f184b2565e

+ 11 - 2
.env.development

@@ -16,14 +16,23 @@ VITE_APP_ID = "ww6076e6fd4268ee31"
 # 微信开发环境基础重定向url
 REDIRECT_BASE_URL = "http://cxinv.api.caixiao365.com"
 # 开发环境后端用户地址
-VITE_PROXY_USER_REAL = "http://cxinv.api.caixiao365.com"
+VITE_PROXY_USER_REAL1 = "http://user.test241.wanyuhengtong.com"
+# 开发环境后端用户地址
+VITE_PROXY_USER_REAL = "http://stockinv.test241.wanyuhengtong.com"
 # 开发环境后端业务地址
-VITE_PROXY_DOMAIN_REAL = "http://cxinv.api.caixiao365.com"
+VITE_PROXY_DOMAIN_REAL = "http://stockinv.test241.wanyuhengtong.com"
 
 VITE_IS_PROD = true
 
 # 跳转结算地址
 VITE_PURCHASE_URL = 'http://pin.caixiao365.com/'
 
+# 报表地址
+VITE_DASHBOARD_URL = 'http://web.report.caixiao365.com/'
+
 # token密钥
 VITE_SECRET_KEY = 'key123'
+
+
+# 跳转工单地址
+VITE_GD_URL = 'http://bug.caixiao365.com/'

+ 5 - 0
src/api/parameter/tagManage/index.ts

@@ -35,3 +35,8 @@ export const httpDelete = (data: object): any => {
 export const httpBillAddTag = (data: object): any => {
   return http.request("post", `${yewuApi}addtag`, { data });
 };
+
+
+export const httpUnTag = (data: object): any => {
+  return http.request("post", `${yewuApi}TagGood/checkTag`, { data });
+};

+ 126 - 0
src/components/PageContent/src/actions/action-un-tag.tsx

@@ -0,0 +1,126 @@
+import { defineComponent, ref, watchEffect, nextTick, computed } from "vue";
+import { httpUnTag } from "/@/api/parameter/tagManage";
+import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
+import SingleVue from "/@/components/ImageUpload/src/single.vue";
+import { useAsync } from "/@/hooks/core/useAsync";
+import { UnitInput } from "/@/components/Input";
+
+import {
+  ElButton,
+  ElDialog,
+  ElForm,
+  ElFormItem,
+  ElInput,
+  ElInputNumber,
+  ElOption,
+  ElPopconfirm,
+  ElSelect,
+  ElTooltip
+} from "element-plus";
+
+const defaultFormData = {
+  tag_id: "",
+  code: "",
+  total_fee: 0,
+  tag_remark: "",
+  tag_img: ""
+};
+
+const props = {
+  tagProps: {
+    type: Object as PropType<Record<string, string>>
+  },
+  row: {
+    type: Object as PropType<Record<string, string>>
+  },
+  isPay: {
+    type: Boolean
+  }
+};
+
+const MAP = [
+  {
+    value: "1",
+    label: "付款"
+  },
+  {
+    value: "2",
+    label: "回票"
+  },
+  {
+    value: "3",
+    label: "回款"
+  },
+  {
+    value: "4",
+    label: "开票"
+  }
+];
+
+const coinIconTypes = ["1", "3"];
+
+const ActionUnTag = defineComponent({
+  name: "ActionTag",
+  props,
+  emits: ["reload"],
+  setup(props, { emit }) {
+    const visible = ref(false);
+    const formRef = ref<InstanceType<typeof ElForm>>(null);
+    const formData = ref({ ...defaultFormData });
+
+    const { run: addtagRun, loading: addtagLoading } = useAsync({
+      success: () => {
+        visible.value = false;
+        emit("reload");
+      }
+    });
+
+    const onAddTagWithCode = () => {
+      const { row } = props;
+      const { tagProps } = props;
+      const { type } = tagProps;
+
+      addtagRun(
+        httpUnTag({ logid: type === "1" ? row.pay_tag_id : row.inv_tag_id })
+      );
+    };
+
+    const title = computed(() => {
+      const { tagProps } = props;
+      const { type } = tagProps;
+      if (!type) return;
+      return MAP.find(s => s.value === type)?.label;
+    });
+
+    watchEffect(() => {
+      if (visible.value) formData.value = { ...defaultFormData };
+      nextTick(() => formRef.value && formRef.value.clearValidate());
+    });
+
+    return () => (
+      <ElPopconfirm
+        v-loading={addtagLoading.value}
+        placement="top"
+        title={`确认解除${title.value}标签?`}
+        onConfirm={onAddTagWithCode}
+        v-slots={{
+          reference: () => (
+            <ElTooltip placement="top" content={`解除${title.value}标签`}>
+              <ElButton
+                link
+                class="reset-margin"
+                type="default"
+                onClick={() => (visible.value = true)}
+                icon={useRenderIcon(
+                  coinIconTypes.includes(props.tagProps.type) ? "coin" : "stamp"
+                )}
+              />
+            </ElTooltip>
+          )
+        }}
+      />
+    );
+  }
+});
+
+export default ActionUnTag;

+ 2 - 0
src/components/PageContent/src/actions/index.ts

@@ -4,8 +4,10 @@ import Update from "./action-update";
 import Preview from "./action-preview";
 import Status from "./action-status";
 import Tag from "./action-tag";
+import UnTag from "./action-un-tag";
 
 const Operation = {
+  UnTag,
   Create,
   Update,
   Delete,

+ 26 - 0
src/components/PageContent/src/page-content.tsx

@@ -85,6 +85,8 @@ const PageContent = defineComponent({
         showPreview,
         showPayTagFn,
         showReturnTagFn,
+        showUnPayTagFn,
+        showUnReturnTagFn,
         isRequesetArray,
         superUserNoAction,
         superUserNoPerview,
@@ -103,6 +105,9 @@ const PageContent = defineComponent({
       const showPay = showPayTagFn ? showPayTagFn(row, powers) : true;
       const showReturn = showReturnTagFn ? showReturnTagFn(row, powers) : true;
 
+      const showUnPay = showUnPayTagFn ? showUnPayTagFn(row,powers) && Number(row.pay_tag_id) !== 0 : false;
+      const showUnReturn = showUnReturnTagFn ? showUnReturnTagFn(row, powers)  && Number(row.inv_tag_id) !== 0 : false;
+
       const _showStatus = showStatus
         ? showStatus(isSuperUser.value)
         : action.status &&
@@ -138,6 +143,27 @@ const PageContent = defineComponent({
             />
           )}
 
+{
+            returnProps && showUnReturn && (
+              <Operation.UnTag 
+                row={row}
+                tagProps={returnProps}
+                onReload={() => onSearch()}
+              />
+            )
+          }
+
+          {
+            payProps && showUnPay && (
+              <Operation.UnTag 
+                row={row}
+                isPay
+                tagProps={payProps}
+                onReload={() => onSearch()}
+              />
+            )
+          }
+
           {action.update && powers.some(i => i == "005") && noAction && (
             <Operation.Update
               onUpdate={() => emit("updateBtnClick", row)}

+ 2 - 0
src/components/PageContent/src/types.ts

@@ -47,6 +47,8 @@ export interface ContentConfig {
   showDelete?: (row: Record<string, string>) => boolean;
   showExpand?: (row: Record<string, string>) => boolean;
   showPayTagFn?: (row: Record<string, string>, permissions: any[]) => boolean;
+  showUnPayTagFn?: (row: Record<string, string>, permissions: any[]) => boolean;
+  showUnReturnTagFn?: (row: Record<string, string>, permissions: any[]) => boolean;
   handleData?: (data: any, parmas: any) => any;
   tableRowClassName?:(...rest:any[]) => any;
 

+ 4 - 0
src/utils/btnList.ts

@@ -56,5 +56,9 @@ const btnList = [
   { code: "053", name: "业务公司财务审核" },
   { code: "054", name: "业务公司认证" },
 
+
+  { code: "055", name: "解除采购对账付款标签" },
+  { code: "056", name: "解除采购对账回票标签" }
+
 ];
 export default btnList;

+ 6 - 1
src/views/purchase/orderRecord/config/content.config.ts

@@ -89,7 +89,7 @@ const columns = [
   {
     label: "操作",
     fixed: "right",
-    width: 135,
+    width: 205,
     slot: "operation"
   }
 ];
@@ -116,6 +116,11 @@ const contentConfig: ContentConfig = {
     String(status) === "2" && permissions.includes("013") && String(is_comon) !== "1",
   showReturnTagFn: ({ status, is_comon }, permissions) =>
     String(status) === "2" && permissions.includes("014") && String(is_comon) !== "1",
+
+  showUnPayTagFn: ({ status, is_comon }, permissions) =>
+    String(status) === "2" && permissions.includes("055") && String(is_comon) !== "1",
+  showUnReturnTagFn: ({ status, is_comon }, permissions) =>
+    String(status) === "2" && permissions.includes("056") && String(is_comon) !== "1",
 };
 
 export default contentConfig;

+ 7 - 2
src/views/purchase/orderRecord/index.vue

@@ -32,7 +32,12 @@ const hooks: PageHooks = {
   pageSearchHook: () => usePageSearch(undefined, undefined, searchConfig)
 };
 
-const handleRevoke = payNo => {
+const handleRevoke = ({payNo, pay_tag_id}) => {
+  if(Number(pay_tag_id) !== 0){
+    ElMessage.warning('请先解除付款标签再撤销对账单')
+    return
+  }
+
   revoke(
     httpStatus({
       payNo,
@@ -147,7 +152,7 @@ function onDownloadTemplate() {
             link
             text
             :icon="useRenderIcon('refresh-right')"
-            @click="() => handleRevoke(row.payNo)"
+            @click="() => handleRevoke(row)"
           />
         </ElTooltip>
       </template>

+ 7 - 2
src/views/supply/orderRecord/index.vue

@@ -96,7 +96,12 @@ async function onDownloadPayInfo() {
   });
 }
 
-const handleRevoke = payNo => {
+const handleRevoke = ({payNo, pay_tag_id}) => {
+  if(Number(pay_tag_id) !== 0){
+    ElMessage.warning('请先解除付款标签再撤销对账单')
+    return;
+  }
+
   revoke(
     httpStatus({
       payNo,
@@ -146,7 +151,7 @@ const handleRevoke = payNo => {
             link
             text
             :icon="useRenderIcon('refresh-right')"
-            @click="() => handleRevoke(row.payNo)"
+            @click="() => handleRevoke(row)"
           />
         </ElTooltip>
       </template>