snow 2 years ago
parent
commit
6570f4a2e2

+ 35 - 10
src/views/InvoiceSales/refund/components/create-refund/capital-modal.vue

@@ -68,7 +68,12 @@ defineExpose({
 </script>
 
 <template>
-  <el-dialog v-model="visible" title="资金认领" center @open="() => requestPaymentlist()">
+  <el-dialog
+    v-model="visible"
+    title="资金认领"
+    center
+    @open="() => requestPaymentlist()"
+  >
     <div flex mb-2>
       <div flex flex-1 gap="5" pr="20px">
         <el-input placeholder="资金编号" size="small" v-model="params.tradNo" />
@@ -76,23 +81,43 @@ defineExpose({
       </div>
 
       <div flex width="120px">
-        <el-button size="small" type="primary" @click="() => onSearch()">搜索</el-button>
+        <el-button size="small" type="primary" @click="() => onSearch()"
+          >搜索</el-button
+        >
         <el-button size="small" @click="() => onSearch(true)">重置</el-button>
       </div>
     </div>
 
-    <el-table border ref="tableRef" :data="data" size="small" row-key="id" @selection-change="handleSelectionChange"
-      v-loading="loading">
+    <el-table
+      border
+      ref="tableRef"
+      :data="data"
+      size="small"
+      row-key="id"
+      @selection-change="handleSelectionChange"
+      v-loading="loading"
+    >
       <el-table-column type="selection" width="55" />
-      <el-table-column v-for="{ field, label, width } in columns" :key="field" :prop="field" :label="label"
-        :width="width" show-overflow-tooltip />
+      <el-table-column
+        v-for="{ field, label, width } in columns"
+        :key="field"
+        :prop="field"
+        :label="label"
+        :width="width"
+        show-overflow-tooltip
+      />
     </el-table>
 
     <div flex justify-between mt-2>
-      <el-pagination :total="pagination.total" v-model:current-page="pagination.currentPage"
-        @current-change="requestPaymentlist" />
-
-      <el-button type="primary" size="small" @click="handleConfirm">确定</el-button>
+      <el-pagination
+        :total="pagination.total"
+        v-model:current-page="pagination.currentPage"
+        @current-change="requestPaymentlist"
+      />
+
+      <el-button type="primary" size="small" @click="handleConfirm"
+        >确定</el-button
+      >
     </div>
   </el-dialog>
 </template>

+ 26 - 6
src/views/InvoiceSales/returnTicket/components/approval-pending.vue

@@ -1,9 +1,12 @@
 <script setup lang="ts">
-import { reactive, ref, computed } from "vue";
+import { reactive, ref, computed, watchEffect } from "vue";
 import { ElForm } from "element-plus";
 
 const props = defineProps<{
   isNormal?: boolean;
+  isJs?: boolean;
+  isOutMonth?: string;
+  invType?: string;
 }>();
 
 const emit = defineEmits(["approval"]);
@@ -14,7 +17,7 @@ const formData = reactive({
   return_type: "2",
   return_reason: "",
   remark: "",
-  status: "",
+  status: "1",
   invCode: "",
   invNum: "",
   open_date: "",
@@ -46,7 +49,7 @@ const rules = reactive({
   ],
   remark: [
     {
-      required: true,
+      required: false,
       trigger: "change",
       message: "请输入备注"
     }
@@ -106,10 +109,27 @@ const noPassRule = reactive({
 });
 
 const formRef = ref<InstanceType<typeof ElForm>>(null);
+const outMonthAndPaper = ref(false);
 
 const handlePaymentReceipt = () => {
-  formRef.value.validate(isValid => isValid && emit("approval", formData));
+  formRef.value.validate(
+    isValid => isValid && emit("approval", formData, outMonthAndPaper)
+  );
 };
+
+watchEffect(() => (formData.return_type = props.isJs ? "1" : "2"));
+
+watchEffect(() => {
+  const { invType, isOutMonth } = props;
+  //类型是否跨月
+  outMonthAndPaper.value =
+    String(isOutMonth) === "1" &&
+    (invType === "normal" || invType === "special");
+
+  //校验码是否必填
+  rules.checkCode[0].required =
+    invType === "special_electronic" || invType === "electronic";
+});
 </script>
 
 <template>
@@ -127,14 +147,14 @@ const handlePaymentReceipt = () => {
       </el-select>
     </el-form-item>
 
-    <template v-if="formData.status !== '3'">
+    <template v-if="formData.status !== '3' || outMonthAndPaper">
       <el-form-item label="退票方式" prop="return_type">
         <el-select
           w-300px
           v-model="formData.return_type"
           placeholder="请选择退票方式"
         >
-          <el-option value="1" label="金税" />
+          <el-option :disabled="!isJs" value="1" label="金税" />
           <el-option value="2" label="线下" />
         </el-select>
       </el-form-item>

+ 5 - 11
src/views/InvoiceSales/returnTicket/config/_details.ts

@@ -12,28 +12,23 @@ import {
 export const invReturnColumns: DescriptionColumns = [
   {
     field: "returnCode",
-    label: "退票编号",
-    span: 2
+    label: "退票编号"
   },
   {
     field: "invNo",
-    label: "开票申请编号",
-    span: 2
+    label: "开票申请编号"
   },
   {
     field: "post_code",
-    label: "物流编号",
-    span: 2
+    label: "物流编号"
   },
   {
     field: "red_inv",
-    span: 2,
     label: "红冲发票信息"
   },
   {
     field: "return_reason",
     label: "红冲原因",
-    span: 1,
     render(data) {
       return h(ElTag, null, {
         default: () =>
@@ -54,7 +49,6 @@ export const invReturnColumns: DescriptionColumns = [
   {
     field: "open_type",
     label: "开票类型",
-    span: 2,
     render(data) {
       return h(ElTag, null, {
         default: () =>
@@ -64,7 +58,7 @@ export const invReturnColumns: DescriptionColumns = [
   },
   {
     field: "apply_name",
-    span: 2,
+
     label: "申请人",
     render: (apply_name, { apply_id }) =>
       createTooltip(apply_name, "申请人ID : " + apply_id, 160)
@@ -91,7 +85,7 @@ export const invReturnColumns: DescriptionColumns = [
   },
   {
     field: "inv_value",
-    span: 2,
+
     label: "发票总额"
   },
   {

+ 37 - 1
src/views/InvoiceSales/returnTicket/detail.vue

@@ -51,6 +51,24 @@ const isNormal = computed(() => {
   return inv_type === "2" || inv_type === "3";
 });
 
+//是否支持金税
+const isJS = computed(() => {
+  const { open_type } = data.value;
+  return String(open_type) === "1";
+});
+
+//是否跨月
+const is_out_month = computed(() => {
+  const { is_out_month } = data.value;
+  return is_out_month;
+});
+
+//发票类型
+const inv_type = computed(() => {
+  const { inv_type } = data.value;
+  return inv_type;
+});
+
 function handleApproval(_data) {
   const params = {
     ..._data,
@@ -60,7 +78,22 @@ function handleApproval(_data) {
   approval(httpStatus(params));
 }
 
-const handleCreate = _data => create(httpAdd(_data));
+const handleCreate = (_data, isOutMonthOrPapar = false) => {
+  const { inv_number, inv_code, open_time } = data.value;
+
+  const params = {
+    inv_number,
+    inv_code,
+    open_time
+  };
+
+  create(
+    httpAdd({
+      ..._data,
+      ...(isOutMonthOrPapar ? params : {})
+    })
+  );
+};
 
 if (isDetail.value) detail(httpDetail({ returnCode: id.value }));
 </script>
@@ -96,6 +129,9 @@ if (isDetail.value) detail(httpDetail({ returnCode: id.value }));
               >
                 <ApprovalPending
                   :isNormal="isNormal"
+                  :is-js="isJS"
+                  :is-out-month="is_out_month"
+                  :inv-type="inv_type"
                   :company-no="data.companyNo"
                   @approval="handleApproval"
                 />