Browse Source

Merge branch 'v3.0' into sit

snow 10 months ago
parent
commit
38e20f8f1a

BIN
dist-zip/build.zip


+ 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 });
+};

+ 1 - 1
src/api/postSupplierOrder/sendOrder/index.ts

@@ -21,6 +21,6 @@ export const httpAdd = (data: object): any => {
 
 
 // 运单删除
-export const httpDelete = (data: onject):any => {
+export const httpDelete = (data: onject): any => {
   return http.request("post", `${yewuApi}track/delete`, { 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;

+ 5 - 0
src/views/postSupplierOrder/sendOrder/batchImportSendOrder.vue

@@ -44,6 +44,11 @@ function handleImportData({ results, header }) {
 }
 
 function onSubmit() {
+  if(list.value.length > 100){
+    ElMessage.warning('导入发货运单不能超过100条')
+    return;
+  }
+  
   const companies = [...new Set(list.value.map(item => item.companyNo))];
   if (companies.length > 1) { 
     ElMessage.warning('上传多条数据业务公司必须一致')

+ 5 - 5
src/views/postSupplierOrder/sendOrderRecord/config/search.config.ts

@@ -31,11 +31,11 @@ const searchFormConfig: FormConfig = {
       field: "payNo",
       placeholder: '对账编号'
     },
-    {
-      type: "input",
-      field: "payNo",
-      placeholder: '对账付款编号'
-    }
+    // {
+    //   type: "input",
+    //   field: "payNo",
+    //   placeholder: '对账付款编号'
+    // }
   ]
 };
 

+ 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>

+ 8 - 0
src/views/supplierOrder/sendOrder/batchImportSendOrder.vue

@@ -48,6 +48,11 @@ function handleImportData({ results, header }) {
 
 
 function onSubmit() {
+  if(list.value.length > 100){
+    ElMessage.warning('导入发货运单不能超过100条')
+    return;
+  }
+
   const suppliers = [...new Set(list.value.map(item => item.supplierNo))];
   if (suppliers.length > 1) { 
     ElMessage.warning('上传多条数据供应商必须一致')
@@ -62,6 +67,9 @@ function onSubmit() {
   const { errorSet, isValid } = validateData(list.value);
   if (!isValid) { showErrorSet(errorSet); return; }
 
+
+
+
   const parameter = list.value.map(({ outChildCode, supplierNo, companyNo, post_fee , remark }) => ({
      outChildCode, supplierNo, companyNo, remark, post_fee: Number(post_fee).toFixed(2)
   }))

+ 0 - 1
src/views/supplierOrder/sendOrderPay/config/search.config.ts

@@ -30,7 +30,6 @@ const searchFormConfig: FormConfig = {
       type: "business-query",
       placeholder: '业务公司'
     },
-
     {
       field: "dzNo",
       type: "input",

+ 5 - 5
src/views/supplierOrder/sendOrderRecord/config/search.config.ts

@@ -30,12 +30,12 @@ const searchFormConfig: FormConfig = {
       type: "input",
       field: "payNo",
       placeholder: '对账编号'
-    },
-    {
-      type: "input",
-      field: "payNo",
-      placeholder: '对账付款编号'
     }
+    // {
+    //   type: "input",
+    //   field: "payNo",
+    //   placeholder: '对账付款编号'
+    // }
   ]
 };
 

+ 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>