ly il y a 1 an
Parent
commit
89019f4e80

+ 1 - 1
src/utils/zTool.js

@@ -412,7 +412,7 @@ let zTool = {
 			// 在canvas上绘制原始图片
 			ctx.drawImage(image, 0, 0);
 			// 添加水印文本
-			ctx.font = '20px Arial';
+			ctx.font = '15px Arial';
 			ctx.fillStyle = 'rgb(228,233,229)';
 			const watermarkText = name; // 水印文本
 			const angle = 15 * Math.PI / 180; // 将15度转换为弧度

+ 1 - 2
src/views/business/crm/order/form.vue

@@ -1244,6 +1244,7 @@ const props = defineProps({
 const { getList } = toRefs(props);
 /** 字典数组区 */
 const { virtual_address } = proxy.useDict("virtual_address");
+
 /** 表单抽屉 页变量 */
 const title = ref("");
 const loading = ref(false);
@@ -1337,7 +1338,6 @@ const { form, rules } = toRefs(data);
 function open(id) {
   reset();
   visible.value = true;
-  // console.log(virtual_address.value)
   if (id) {
     Promise.all([initTaskTypes(), listSource(), getOrder(id)]).then((res) => {
       loopTasks.value = res[0].data.loopTasks;
@@ -1351,7 +1351,6 @@ function open(id) {
       editStatus.value = false;
       title.value = "修改订单信息";
       initRegion();
-      
     });
     // getOrder(id).then(response => {
     // })

+ 11 - 1
src/views/business/financial/payment/form.vue

@@ -347,6 +347,16 @@
                       <span>{{ rowNum(scope.row.amount) }}</span>
                     </template>
                   </el-table-column>
+                  <el-table-column
+                  label="已收款金额"
+                  prop="amount"
+                  width="100"
+                  align="center"
+                >
+                  <template #default="scope">
+                    <span>{{ rowNum(scope.row.abc) }}</span>
+                  </template>
+                </el-table-column>
                   <el-table-column
                     label="本次支出金额"
                     prop="paymentAmount"
@@ -378,7 +388,7 @@
                     </template>
                   </el-table-column>
                   <el-table-column
-                    label="已支金额"
+                    label="已支金额"
                     prop="payment"
                     width="100"
                     align="center"

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

@@ -204,7 +204,7 @@
       <el-button type="warning" size="small" icon="Edit" style="float: right" @click="handleSave(1)">
         待确认</el-button>
     </div>
-    <import-excel-dialog-customer ref="importExcelDialogRef"  :companyId = "companyId"/>
+    <import-excel-dialog-customer ref="importExcelDialogRef"  :companyId = "companyId" v-bind="$attrs" @loadData ="loadData"/>
     <!-- <feedback-dialog ref="feedbackDialogView" :parent="this" />
     <print-dialog ref="printDialog" :parent="this" /> -->
   </el-dialog>

+ 13 - 4
src/views/business/production/salary/importExcelDialogCustomer.vue

@@ -89,11 +89,12 @@
 
 
 <script setup>
-// import { exportSalaryTemplateNotCompany } from "@/api/business/production/salary";
+import { exportSalaryTemplateNotCompany } from "@/api/business/production/salary";
 import { getToken, getTenant } from "@/utils/auth";
 import useUserStore from "@/store/modules/user";
 import { deepClone } from "@/utils";
-
+import {  useAttrs } from "vue";
+const attrs = useAttrs();
 const { proxy } = getCurrentInstance();
 /** 父组件传参 */
 const props = defineProps({
@@ -101,8 +102,14 @@ const props = defineProps({
     type: String,
     default: () => {},
   },
+  loadData:{
+    type:Function,
+    default:()=>{}
+  }
 });
-const { companyId } = toRefs(props);
+const { companyId  } = toRefs(props);
+
+const emits = defineEmits(["loadData"]);
 /** 字典数组区 */
 /** 表单抽屉 页变量 */
 const fileList = ref([]);
@@ -198,7 +205,9 @@ const handleFileSuccess = (response, file, fileList) => {
     "导入结果",
     { dangerouslyUseHTMLString: true }
   );
-  // getList.value();
+  attrs.onGetList();
+  emits("loadData");
+
 };
 /** 提交上传文件 */
 function submitFileForm() {

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

@@ -122,7 +122,7 @@
     <!-- 分页 -->
     <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
       v-model:limit="queryParams.pageSize" @pagination="getList" />
-    <form-dialog ref="formDialogRef" :get-list="getList" />
+    <form-dialog ref="formDialogRef" :get-list="getList"  @getList = "getList"/>
     <import-excel-dialog ref="importExcelDialogRef" :get-list="getList" />
     <view-dialog ref="viewDialogRef" :get-list="getList" />
     <!-- 更多搜索弹窗 -->

+ 14 - 5
src/views/business/production/salaryZero/form.vue

@@ -33,7 +33,7 @@
           <el-col :span="24" class="details-container">
             <!--操作按钮 开始-->
             <div class="details-head">
-              <div class="title">
+              <div class="title" style="margin-bottom: 10px;">
                 <i class="fa fa-th-list" aria-hidden="true" /> 人员信息
               </div>
               <el-button
@@ -44,6 +44,9 @@
               >
                 新增</el-button
               >
+              <el-button class="button-class" type="primary" icon="plus" size="small" @click="handleImport"
+              v-hasPermi="['business:salary:import']">
+              导入</el-button>
               <el-button
                 v-if="selections.length > 0"
                 type="danger"
@@ -53,7 +56,7 @@
                 >删除</el-button
               >
             </div>
-            <div class="details-body">
+            <div class="details-body" style="margin-top: 10px;">
               <div>
                 <el-table
                   ref="sourceTable"
@@ -412,6 +415,7 @@
         待确认</el-button
       >
     </div>
+    <import-excel-dialog-customer ref="importExcelDialogRef"  :companyId = "companyId" v-bind="$attrs" @loadData ="loadData"/>
     <!-- <feedback-dialog ref="feedbackDialogView" :parent="this" />
     <print-dialog ref="printDialog" :parent="this" /> -->
   </el-dialog>
@@ -423,13 +427,14 @@ import {
   updateDetail,
 } from "@/api/business/production/salaryZero";
 import { rowNum, numberToCurrencyNo } from "@/utils/index";
+import importExcelDialogCustomer from "./importExcelDialogCustomer.vue";
 import { ref } from "vue";
 const { proxy } = getCurrentInstance();
 const visible = ref(false);
 const width = ref(1420);
 const selections = ref([]);
 const currentSource = ref(null);
-
+const importExcelDialogRef = ref(null);
 const props = defineProps({
   getList: {
     type: Function,
@@ -479,7 +484,7 @@ const employeeEmptyData = {
 };
 
 const form = ref({});
-
+const  companyId = ref(null)
 const emptyForm = {
   details: [],
 };
@@ -487,6 +492,7 @@ const emptyForm = {
 function open(detail) {
   visible.value = true;
   form.value = detail;
+  companyId.value = detail.companyId
   console.log(form.value);
   loadData();
 }
@@ -510,7 +516,10 @@ function close() {
 function reset() {
   form.value = proxy.deepClone(emptyForm);
 }
-
+ //导入按钮操作
+ function handleImport() {
+    importExcelDialogRef.value.open();
+  }
 function printSalary() {}
 function exportSalary() {}
 

+ 236 - 0
src/views/business/production/salaryZero/importExcelDialogCustomer.vue

@@ -0,0 +1,236 @@
+<template>
+  <!-- 添加或修改菜单对话框 -->
+  <el-dialog
+    title="工资导入"
+    v-model="visible"
+    width="680px"
+    append-to-body
+    draggable
+  >
+    <el-form
+      ref="menuRef"
+      :model="form"
+      size="small"
+      :rules="rules"
+      label-width="100px"
+    >
+      <el-row>
+        <el-col :span="24">
+          <el-form-item label="选择导入月份" prop="year">
+            <el-date-picker
+              v-model="currentMonth"
+              type="month"
+              format="YYYY年MM月"
+              style="width: 150px"
+              :clearable="false"
+              value-format="YYYY-MM-01"
+              :disabled-date="disabledDateHandler"
+              @change="monthChangeHandler"
+            />
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="24">
+          <el-form-item label="上传">
+            <el-upload
+              ref="uploadRef"
+              :limit="1"
+              accept=".xlsx, .xls"
+              :headers="upload.headers"
+              :action="upload.url + `?year=${year}&month=${month}&companyId=${companyId}`"
+              :fileList="fileList"
+              :before-upload="handleBeforeUpload"
+              :disabled="upload.isUploading"
+              :on-progress="handleFileUploadProgress"
+              :on-success="handleFileSuccess"
+              :auto-upload="false"
+              drag
+            >
+              <el-icon class="el-icon--upload">
+                <upload-filled />
+              </el-icon>
+              <div class="el-upload__text">
+                将文件拖到此处,或<em>点击上传</em>
+              </div>
+              <template #tip>
+                <div class="el-upload__tip text-center">
+                  <span
+                    >仅允许导入xls、xlsx格式文件。文件大小限制为&lt;50Mb</span
+                  >
+                  <el-link
+                    type="primary"
+                    :underline="false"
+                    style="font-size: 12px; vertical-align: baseline"
+                    @click="importTemplate"
+                    >下载模板</el-link
+                  >
+                </div>
+              </template>
+            </el-upload>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button
+          type="primary"
+          icon="Finished"
+          size="small"
+          @click="submitForm"
+          >确 定</el-button
+        >
+        <el-button icon="Close" size="small" @click="cancel">取 消</el-button>
+      </div>
+    </template>
+  </el-dialog>
+</template>
+
+
+<script setup>
+// import { exportSalaryTemplateNotCompany } from "@/api/business/production/salary";
+import { getToken, getTenant } from "@/utils/auth";
+import useUserStore from "@/store/modules/user";
+import { deepClone } from "@/utils";
+import {  useAttrs } from "vue";
+const attrs = useAttrs();
+const { proxy } = getCurrentInstance();
+/** 父组件传参 */
+const props = defineProps({
+  companyId: {
+    type: String,
+    default: () => {},
+  },
+  loadData:{
+    type:Function,
+    default:()=>{}
+  }
+});
+const { companyId  } = toRefs(props);
+
+const emits = defineEmits(["loadData"]);
+/** 字典数组区 */
+/** 表单抽屉 页变量 */
+const fileList = ref([]);
+const visible = ref(false);
+const currentMonth = ref(proxy.moment().subtract("month").format("YYYY-MM-01"));
+const year = ref(proxy.moment().format("YYYY"));
+const month = ref(proxy.moment().format("MM"));
+
+const addType = ref(1);
+const webHost = import.meta.env.VITE_APP_BASE_API;
+
+const setHeaders = {
+  Authorization: getToken(),
+};
+
+const data = reactive({
+  form: {
+    year: proxy.moment().format("YYYY"),
+    month: proxy.moment().format("MM"),
+  },
+  followData: {},
+});
+const addComRef = ref(null);
+
+/*** 客户导入参数 */
+const upload = reactive({
+  // 是否禁用上传
+  isUploading: false,
+  // 设置上传的请求头部
+  headers: { Authorization: "Bearer " + getToken(), tenantId: getTenant() },
+  // 上传的地址
+  url: `/ezhizao-yzbh-production/business/salaryZero/importData`,
+});
+
+/** 查询对象 */
+const queryParams = ref({});
+
+const followQuery = ref({});
+const { form, rules, followData } = toRefs(data);
+
+/***********************  表单页方法 ****************************/
+
+/** 抽屉打开 */
+function open() {
+  // reset();
+  visible.value = true;
+}
+
+//下载模板
+const importTemplate = () => {
+  exportSalaryTemplateNotCompany();
+};
+
+function reset() {
+  // console.log(addComRef.value)
+  if (addComRef.value != null) addComRef.value.reset();
+}
+
+function cancel() {
+  visible.value = false;
+}
+
+function submitForm() {
+  submitFileForm();
+}
+
+function handleBeforeUpload(file) {
+  console.log(file);
+  if (
+    file.type !==
+      "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" &&
+    file.type !== "application/vnd.ms-excel"
+  ) {
+    proxy.$modal.msgError("请选择excel文件");
+    return false;
+  }
+  return true;
+}
+
+/**文件上传中处理 */
+const handleFileUploadProgress = (event, file, fileList) => {
+  upload.isUploading = true;
+};
+/** 文件上传成功处理 */
+const handleFileSuccess = (response, file, fileList) => {
+  upload.open = false;
+  upload.isUploading = false;
+  proxy.$refs["uploadRef"].handleRemove(file);
+  proxy.$alert(
+    "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
+      response.msg +
+      "</div>",
+    "导入结果",
+    { dangerouslyUseHTMLString: true }
+  );
+  attrs.onGetList();
+  emits("loadData");
+
+};
+/** 提交上传文件 */
+function submitFileForm() {
+  proxy.$refs["uploadRef"].submit();
+}
+
+function monthChangeHandler(arg) {
+  year.value = proxy.moment(arg).format("YYYY");
+  month.value = proxy.moment(arg).format("MM");
+}
+
+function disabledDateHandler(date) {
+  if (date <= proxy.moment().subtract("month")) {
+    return false;
+  } else {
+    return true;
+  }
+}
+
+// 暴露给父组件的方法
+defineExpose({
+  open,
+});
+</script>
+
+<style></style>

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

@@ -117,7 +117,7 @@
     <!-- 分页 -->
     <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
       v-model:limit="queryParams.pageSize" @pagination="getList" />
-    <form-dialog ref="formDialogRef" :get-list="getList" />
+    <form-dialog ref="formDialogRef" :get-list="getList" @getList = "getList"/>/>
     <view-dialog ref="viewDialogRef" :get-list="getList" />
     <import-excel-dialog ref="importExcelDialogRef" :get-list="getList" />
     <!-- 更多搜索弹窗 -->