ly 1 år sedan
förälder
incheckning
0697c2d8c7

+ 2 - 2
src/views/business/housingFund/confirm/index.vue

@@ -58,11 +58,11 @@
       <el-table-column label="来源" align="center" prop="fromCompanyName" min-width="100" />
       <el-table-column label="纳税性质" width="120" align="center" prop="taxType" />
       <el-table-column label="税号" align="center" prop="socialCreditCode" min-width="200" />
-      <el-table-column label="当前期间" min-width="90" align="center">
+      <el-table-column label="所属期" min-width="90" align="center">
         <template #default="scope">
           <!-- {{ scope.row.currentDate != null && scope.row.currentDate > scope.row.checkoutDate ? scope.row.currentDate :
             scope.row.checkoutDate }} -->
-          {{ moment().format("YYYY年MM月") }}
+            {{ proxy.moment().subtract(1, "month").format("yyyy")+"-"+queryParams.month}}
         </template>
       </el-table-column>
       <el-table-column align="center">

+ 174 - 182
src/views/business/production/archiveTicket/view.vue

@@ -1,20 +1,12 @@
 <template>
-  <el-dialog
-    v-model="visible"
-    :width="width"
-    append-to-body
-    draggable
-    show-close
-    :close-on-click-modal = "false"
-  >
+  <el-dialog v-model="visible" :width="width" append-to-body draggable show-close :close-on-click-modal="false">
     <template #header>
       <div class="dialog-title-container">
         <span class="title-label" style="color: #fff">
           <el-icon>
             <Document />
           </el-icon>
-          票据</span
-        >
+          票据</span>
         <!-- <el-icon @click="close">
           <Close />
         </el-icon> -->
@@ -30,7 +22,7 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="账期" required>
-              <el-select
+              <!-- <el-select
                 v-model="form.currentMonth"
                 style="width: 100%"
                 @change="changeMonthHandle"
@@ -41,7 +33,9 @@
                   :label="`${item.year}-${item.month}`"
                   :value="item.id"
                 />
-              </el-select>
+              </el-select> -->
+              <el-date-picker v-model="form.currentMonth" type="month" placeholder="Pick a month" format="YYYY-MM"
+                @change="changeMonthHandle" />
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -58,12 +52,8 @@
               <el-col v-if="files.length === 0">
                 <el-empty description="没有数据" />
               </el-col>
-              <el-col
-                v-for="(o, index) in files"
-                :key="o.UUID"
-                :span="8"
-                style="margin-bottom: 10px; position: relative"
-              >
+              <el-col v-for="(o, index) in files" :key="o.UUID" :span="8"
+                style="margin-bottom: 10px; position: relative">
                 <el-card :body-style="{ padding: '0px' }">
                   <!-- <img
                     :src="`${baseUrl}${o.fileUrl}`"
@@ -71,8 +61,8 @@
                     style="max-width: 100%; height: 200px"
                   /> -->
                   <el-image :src="`${baseUrl}${o.fileUrl}`" class="image" style="max-width: 100%; height: 200px"
-                  :preview-teleported="true" fit="contain" :preview-src-list="srcList"
-                  @click="vbs(baseUrl + o.fileUrl)" />
+                    :preview-teleported="true" fit="contain" :preview-src-list="srcList" :initial-index="index"
+                    @click="vbs(baseUrl + o.fileUrl)" />
                   <div style="padding: 14px">
                     <div class="bottom clearfix">
                       <el-form-item label="票据类型">
@@ -90,176 +80,178 @@
   </el-dialog>
 </template>
 <script setup>
-import { reactive } from "vue";
-import {
-  listFiles,
-  saveTickets,
-} from "@/api/business/production/archiveTicket";
-import { uploadFile } from "@/api/tool/file";
-const { proxy } = getCurrentInstance();
+  import { reactive } from "vue";
+  import {
+    listFiles,
+    saveTickets,
+  } from "@/api/business/production/archiveTicket";
+  import { uploadFile } from "@/api/tool/file";
+  const { proxy } = getCurrentInstance();
 
-const { ticket_type } = proxy.useDict("ticket_type");
+  const { ticket_type } = proxy.useDict("ticket_type");
 
-const props = defineProps({
-  getList: {
-    type: Function,
-    default: () => {},
-  },
-  width: {
-    type: String,
-    default: "800px",
-  },
-});
-const { getList, width } = toRefs(props);
+  const props = defineProps({
+    getList: {
+      type: Function,
+      default: () => { },
+    },
+    width: {
+      type: String,
+      default: "800px",
+    },
+  });
+  const { getList, width } = toRefs(props);
 
-// import api from '@/api/biz/fileStorage'
-const data = reactive({
-  visible: false,
-  list: [],
-  total: 0,
-  query: {
-    name: "",
+  // import api from '@/api/biz/fileStorage'
+  const data = reactive({
+    visible: false,
+    list: [],
     total: 0,
-    pageSize: 15,
-    pageNum: 1,
-  },
-  files: [],
-  months: [],
-  form: {},
-  selection: [],
-  baseUrl: import.meta.env.VITE_APP_BASE_API,
-  options: {},
-});
-const {
-  visible,
-  list,
-  query,
-  selection,
-  baseUrl,
-  options,
-  total,
-  files,
-  form,
-  months,
-} = toRefs(data);
-const srcList = ref([
-    "https://elevator4s-oss.oss-cn-hangzhou.aliyuncs.com/2021/05/07/b632db6a837f46e0950670277fa9e5e5multipartFile.png"
-  ]);
-function open(arg) {
-  visible.value = true;
-  form.value = arg;
-  form.value.currentMonth = `${form.value.year}-${form.value.month}`;
-  options.value = arg;
-  loadData();
-}
-/**
- * 对话框关闭 事件
- */
-function close() {
-  visible.value = false;
-}
-/**
- * 加载数据
- */
-const loadData = async () => {
-  const res = await listFiles(form.value);
-  files.value = res.data.files;
-  months.value = res.data.months;
-  form.value.isFinished = res.data.finished.isFinished;
-};
-/**
- * 列表checkbox列选择 事件
- */
-function handleSelectionChange(selection) {
-  selection.value = selection;
-}
-/**
- * 搜索 事件
- */
-function handleSearch() {
-  loadData();
-}
-function openFile(attach) {
-  window.open(`${baseUrl.value}/${attach.fileUrl}`, attach.fileName);
-}
-
-function upload(param) {
-  const formData = new FormData();
-  formData.append("file", param.file);
-  uploadFile(formData).then((res) => {
-    if (res.code === 200) {
-      const file = {};
-      file.fileName = res.newFileName;
-      file.url = res.url;
-      file.originalFileName = res.originalFilename;
-      file.fileUrl = res.fileName;
-      files.value.push(file);
-    }
+    query: {
+      name: "",
+      total: 0,
+      pageSize: 15,
+      pageNum: 1,
+    },
+    files: [],
+    months: [],
+    form: {},
+    selection: [],
+    baseUrl: import.meta.env.VITE_APP_BASE_API,
+    options: {},
   });
-}
+  const {
+    visible,
+    list,
+    query,
+    selection,
+    baseUrl,
+    options,
+    total,
+    files,
+    form,
+    months,
+  } = toRefs(data);
+  const srcList = ref([]);
+  function open(arg) {
+    visible.value = true;
+    form.value = arg;
+    form.value.currentMonth = `${form.value.year}-${form.value.month}`;
+    options.value = arg;
+    loadData();
+  }
+  /**
+   * 对话框关闭 事件
+   */
+  function close() {
+    visible.value = false;
+  }
+  /**
+   * 加载数据
+   */
+  const loadData = async () => {
+    const res = await listFiles(form.value);
+    files.value = res.data.files;
+    srcList.value = files.value.map((v) => baseUrl.value + v.fileUrl);
+    months.value = res.data.months;
 
-function changeMonthHandle(item) {
-  const index = months.value.findIndex((v) => v.id === item);
-  if (index >= 0) {
-    const moment =
-      months.value.length > 0
-        ? proxy.moment(
-            `${months.value[index].year}-${months.value[index].month}`,
-            "YYYY-MM"
-          )
-        : null;
-    // console.log(months.value)
-    form.value.year =
-      moment != null ? proxy.moment(moment).format("YYYY") : null;
-    form.value.month =
-      moment != null ? proxy.moment(moment).format("MM") : null;
-  } else {
-    form.value.checkoutId = months.value.length > 0 ? months.value[0].id : 0;
-    const moment =
-      months.value.length > 0
-        ? proxy.moment(
-            `${months.value[0].year}-${months.value[0].month}`,
-            "YYYY-MM"
-          )
-        : null;
-    // console.log(months.value)
-    form.value.year =
-      moment != null ? proxy.moment(moment).format("YYYY") : null;
-    form.value.month =
-      moment != null ? proxy.moment(moment).format("MM") : null;
+    form.value.isFinished = res.data.finished.isFinished;
+  };
+  /**
+   * 列表checkbox列选择 事件
+   */
+  function handleSelectionChange(selection) {
+    selection.value = selection;
+  }
+  /**
+   * 搜索 事件
+   */
+  function handleSearch() {
+    loadData();
+  }
+  function openFile(attach) {
+    window.open(`${baseUrl.value}/${attach.fileUrl}`, attach.fileName);
   }
-  loadData();
-}
 
-function deleteHandle(index) {
-  proxy.$modal
-    .confirm("确定删除?")
-    .then(() => {
-      files.value.splice(index, 1);
-    })
-    .catch(() => {
-      proxy.$modal.msg("已取消删除");
+  function upload(param) {
+    const formData = new FormData();
+    formData.append("file", param.file);
+    uploadFile(formData).then((res) => {
+      if (res.code === 200) {
+        const file = {};
+        file.fileName = res.newFileName;
+        file.url = res.url;
+        file.originalFileName = res.originalFilename;
+        file.fileUrl = res.fileName;
+        files.value.push(file);
+      }
     });
-}
+  }
 
-function handleSave() {
-  const file = {
-    companyId: form.value.companyId,
-    year: form.value.year,
-    month: form.value.month,
-    isFinished: form.value.isFinished,
-    files: files.value,
-  };
-  saveTickets(file).then((res) => {
-    getList.value();
-    close();
-  });
-}
-function vbs(val) {
-    srcList.value = []
-    srcList.value.push(val)
+  function changeMonthHandle(item) {
+
+    // const date = proxy.moment(item).format('YYYY-MM'); // 使用 moment.js 或者其它日期处理库
+    // const index = months.value.findIndex((v) => v.id === date);
+    // if (index >= 0) {
+    //   const moment =
+    //     months.value.length > 0
+    //       ? proxy.moment(
+    //         `${months.value[index].year}-${months.value[index].month}`,
+    //         "YYYY-MM"
+    //       )
+    //       : null;
+    //   // console.log(months.value)
+    //   form.value.year =
+    //     moment != null ? proxy.moment(moment).format("YYYY") : null;
+    //   form.value.month =
+    //     moment != null ? proxy.moment(moment).format("MM") : null;
+    // } else {
+    //   form.value.checkoutId = months.value.length > 0 ? months.value[0].id : 0;
+    //   const moment =
+    //     months.value.length > 0
+    //       ? proxy.moment(
+    //         `${months.value[0].year}-${months.value[0].month}`,
+    //         "YYYY-MM"
+    //       )
+    //       : null;
+    // console.log(months.value)
+    form.value.year =proxy.moment(item).format("YYYY")
+    //   moment != null ? proxy.moment(date).format("YYYY") : null;
+    form.value.month =proxy.moment(item).format("MM")
+    //   moment != null ? proxy.moment(date).format("MM") : null;
+    // }
+    loadData();
+  }
+
+  function deleteHandle(index) {
+    proxy.$modal
+      .confirm("确定删除?")
+      .then(() => {
+        files.value.splice(index, 1);
+      })
+      .catch(() => {
+        proxy.$modal.msg("已取消删除");
+      });
   }
-defineExpose({
-  open,
-});
-</script>
+
+  function handleSave() {
+    const file = {
+      companyId: form.value.companyId,
+      year: form.value.year,
+      month: form.value.month,
+      isFinished: form.value.isFinished,
+      files: files.value,
+    };
+    saveTickets(file).then((res) => {
+      getList.value();
+      close();
+    });
+  }
+  function vbs(val) {
+    // srcList.value = []
+    // srcList.value.push(val)
+  }
+  defineExpose({
+    open,
+  });
+</script>

+ 2 - 2
src/views/business/production/keepAccount/index.vue

@@ -79,11 +79,11 @@
       <el-table-column label="来源" align="center" prop="fromCompanyName" min-width="100" />
       <el-table-column label="纳税性质" min-width="100" align="center" prop="taxType" />
       <el-table-column label="税号" align="center" prop="socialCreditCode" min-width="200" />
-      <el-table-column label="当前期间" width="90" align="center">
+      <el-table-column label="所属期" width="90" align="center">
         <template #default="scope">
           <!-- {{ scope.row.currentDate != null && scope.row.currentDate > scope.row.checkoutDate ? scope.row.currentDate :
             scope.row.checkoutDate }} -->
-          {{ moment().subtract(1, "month").format("YYYY年MM月") }}
+            {{ proxy.moment().subtract(1, "month").format("yyyy")+"-"+queryParams.month}}
         </template>
       </el-table-column>
       <el-table-column align="center">

+ 2 - 2
src/views/business/production/receiveTicket/index.vue

@@ -80,11 +80,11 @@
       <el-table-column label="来源" align="center" prop="fromCompanyName" min-width="90" />
       <el-table-column label="纳税性质" min-width="90" align="center" prop="taxType" />
       <el-table-column label="税号" align="center" prop="socialCreditCode" min-width="180" />
-      <el-table-column label="当前期间" width="90" align="center">
+      <el-table-column label="所属期" width="90" align="center">
         <template #default="scope">
           <!-- {{ scope.row.currentDate != null && scope.row.currentDate > scope.row.checkoutDate ? scope.row.currentDate :
        scope.row.checkoutDate }} -->
-          {{ moment().subtract(1, "month").format("YYYY年MM月") }}
+       {{ proxy.moment().subtract(1, "month").format("yyyy")+"-"+queryParams.month}}
         </template>
       </el-table-column>
       <el-table-column align="center">

+ 1 - 1
src/views/business/production/salary/index.vue

@@ -83,7 +83,7 @@
       <el-table-column label="来源" align="center" min-width="80" prop="fromCompanyName" />
       <el-table-column label="纳税性质" min-width="100" align="center" prop="taxType" />
       <el-table-column label="税号" align="center" prop="socialCreditCode" min-width="200" />
-      <el-table-column label="当前期间" min-width="90" align="center">
+      <el-table-column label="所属期" min-width="90" align="center">
         <template #default="scope">
           <!-- {{
           scope.row.currentDate != null &&

+ 3 - 2
src/views/business/production/salaryZero/index.vue

@@ -84,9 +84,10 @@
       <el-table-column label="来源" align="center" prop="fromCompanyName" min-width="100" />
       <el-table-column label="纳税性质" align="center" min-width="130" prop="taxType" />
       <el-table-column label="税号" align="center" prop="socialCreditCode" min-width="200" />
-      <el-table-column label="当前期间" min-width="90" align="center">
+      <el-table-column label="所属期" min-width="90" align="center">
         <template #default="scope">
-          {{ moment().subtract(1, "month").format("YYYY年MM月") }}
+          <!-- {{ moment().subtract(1, "month").format("YYYY年MM月") }} -->
+          {{ proxy.moment().subtract(1, "month").format("yyyy")+"-"+queryParams.month}}
         </template>
       </el-table-column>
       <el-table-column align="center">

+ 2 - 2
src/views/business/socialSecurity/confirm/index.vue

@@ -59,11 +59,11 @@
       <el-table-column label="来源" align="center" prop="fromCompanyName" width="100" />
       <el-table-column label="纳税性质" width="100" align="center" prop="taxType" />
       <el-table-column label="税号" align="center" prop="socialCreditCode" min-width="200" />
-      <el-table-column label="当前期间" min-width="90" align="center">
+      <el-table-column label="所属期" min-width="90" align="center">
         <template #default="scope">
           <!-- {{ scope.row.currentDate != null && scope.row.currentDate > scope.row.checkoutDate ? scope.row.currentDate :
             scope.row.checkoutDate }} -->
-          {{ moment().format("YYYY年MM月") }}
+            {{ proxy.moment().subtract(1, "month").format("yyyy")+"-"+queryParams.month}}
         </template>
       </el-table-column>
       <el-table-column align="center">