소스 검색

1.修改支付申请 新增 操作列 查看详情 编辑 删除
2.同步新增项目ID 关联工时管家项目

yusm 2 주 전
부모
커밋
e930cd19de

+ 49 - 0
fhKeeper/formulahousekeeper/management-platform-yzr/src/main/java/com/management/platform/controller/PaymentApplicationController.java

@@ -106,5 +106,54 @@ public class PaymentApplicationController {
         }
         return httpRespMsg;
     }
+
+    @RequestMapping("/getDetail")
+    public HttpRespMsg getDetail(Integer id){
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
+        if(null==id){
+            httpRespMsg.setError("数据异常");
+            return httpRespMsg;
+        }
+        PaymentApplication byId = paymentApplicationService.getById(id);
+        httpRespMsg.setData(byId);
+        httpRespMsg.setCode("ok");
+        return httpRespMsg;
+    }
+
+    @RequestMapping("/delete")
+    public HttpRespMsg delete(Integer id){
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
+        if(null==id){
+            httpRespMsg.setError("数据异常");
+            return httpRespMsg;
+        }
+        boolean removeById = paymentApplicationService.removeById(id);
+        if(removeById){
+            httpRespMsg.setCode("ok");
+        }else {
+            httpRespMsg.setError("数据异常");
+        }
+        return httpRespMsg;
+    }
+
+    @RequestMapping("/edit")
+    public HttpRespMsg edit(@RequestBody PaymentApplication paymentApplication){
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
+        if(null==paymentApplication){
+            httpRespMsg.setError("数据异常");
+            return httpRespMsg;
+        }
+        if(null==paymentApplication.getId()){
+            httpRespMsg.setError("数据异常");
+            return httpRespMsg;
+        }
+        boolean removeById = paymentApplicationService.updateById(paymentApplication);
+        if(removeById){
+            httpRespMsg.setCode("ok");
+        }else {
+            httpRespMsg.setError("数据异常");
+        }
+        return httpRespMsg;
+    }
 }
 

+ 14 - 0
fhKeeper/formulahousekeeper/management-platform-yzr/src/main/java/com/management/platform/entity/PaymentApplication.java

@@ -92,6 +92,20 @@ public class PaymentApplication extends Model<PaymentApplication> {
     @TableField("project_code")
     private String projectCode;
 
+
+    /**
+     * 项目编号
+     */
+    @TableField("project_id")
+    private Integer projectId;
+
+
+    /**
+     * 项目名称
+     */
+    @TableField("project_name")
+    private String projectName;
+
     /**
      * 付款方式
      */

+ 16 - 0
fhKeeper/formulahousekeeper/management-platform-yzr/src/main/java/com/management/platform/service/impl/FeishuInfoServiceImpl.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.util.StringUtil;
 import com.management.platform.constant.Constant;
 import com.management.platform.entity.*;
 import com.management.platform.entity.bo.*;
@@ -1539,6 +1540,14 @@ public class FeishuInfoServiceImpl extends ServiceImpl<FeishuInfoMapper, FeishuI
             paymentApplication.setPaymentDate(LocalDate.parse(paymentDate));
             paymentApplication.setBankAccount(bankAccount);
 
+            if(null!=projectCode&& StringUtil.isNotEmpty(projectCode)){
+                Project project = projectMapper.selectOne(new LambdaQueryWrapper<Project>().eq(Project::getProjectCode, projectCode));
+                if(project!=null){
+                    paymentApplication.setProjectName(project.getProjectName());
+                    paymentApplication.setProjectId(project.getId());
+                }
+            }
+
             // 设置创建日期(从startTime转换)
             if (startTime != null) {
                 LocalDateTime createAt = Instant.ofEpochMilli(startTime)
@@ -1568,6 +1577,13 @@ public class FeishuInfoServiceImpl extends ServiceImpl<FeishuInfoMapper, FeishuI
                     System.out.println("插入PaymentApplication失败");
                     return false;
                 }
+            }else {
+                paymentApplication.setId(oldPayment.getId());
+                int updateResult  = paymentApplicationMapper.updateById(paymentApplication);
+                if (updateResult <= 0) {
+                    System.out.println("更新PaymentApplication失败");
+                    return false;
+                }
             }
             return true;
 

+ 8 - 1
fhKeeper/formulahousekeeper/management-platform-yzr/src/main/resources/sql/2026-04-21.sql

@@ -27,4 +27,11 @@ CREATE TABLE `payment_application`  (
 #按照顺序执行
 INSERT INTO sys_module VALUES(null,'支付申请','/paymentApplication',null,null,13,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0);
 select id from sys_module where name="支付申请";
-insert into sys_role_module values(55733,33);
+insert into sys_role_module values(55733,33);
+
+#2026-04-23
+ALTER TABLE payment_application
+ADD COLUMN project_id int(10)  AFTER project_code;
+
+ALTER TABLE payment_application
+ADD COLUMN project_name VARCHAR(200) AFTER project_code;

+ 274 - 55
fhKeeper/formulahousekeeper/timesheet-yzr/src/views/paymentApplication/paymentApplication.vue

@@ -127,7 +127,8 @@
                     currentClick == '2-1' &&
                     (user.roleName == '超级管理员' ||
                       user.roleName == '系统管理员' ||
-                      user.roleName == '财务管理员')
+                      user.roleName == '财务管理员' ||
+                      user.roleName == '人事财务')
                   "
                 >
                   <el-button @click="showSyncFeiShuDialog = true" size="small"
@@ -153,6 +154,8 @@
             </el-table-column>
             <el-table-column prop="projectCode" label="项目编号" width="200">
             </el-table-column>
+            <el-table-column prop="projectName" label="项目名称" width="200">
+            </el-table-column>
             <el-table-column
               prop="submitterDept"
               label="提交人所属部门"
@@ -162,6 +165,11 @@
             <el-table-column prop="submitterName" label="提交人" width="200">
             </el-table-column>
             <el-table-column prop="paymentReason" label="付款事由" width="200">
+              <template slot-scope="scope">
+                <span style="font-size: 12px">{{
+                  scope.row.paymentReason
+                }}</span>
+              </template>
             </el-table-column>
             <el-table-column prop="paymentMethod" label="付款方式" width="200">
             </el-table-column>
@@ -183,7 +191,7 @@
             </el-table-column>
             <el-table-column prop="bankAccount" label="银行账户" width="200">
             </el-table-column>
-            <!-- <el-table-column fixed="right" :label="$t('operation')" width="160">
+            <el-table-column fixed="right" :label="$t('operation')" width="160">
               <template slot-scope="scope">
                 <div v-if="!isAuditList">
                   <el-button
@@ -192,6 +200,14 @@
                     size="mini"
                     @click.stop.native="downloadByA(scope.row)"
                   ></el-button>
+                  <el-button
+                    icon="el-icon-edit"
+                    circle
+                    size="mini"
+                    style="margin-left: 10px"
+                    @click.stop.native="showEditName(scope.row)"
+                    v-show="permissions.costAudit"
+                  ></el-button>
                   <el-button
                     icon="el-icon-delete"
                     circle
@@ -206,7 +222,7 @@
                   ></el-button>
                 </div>
               </template>
-            </el-table-column> -->
+            </el-table-column>
           </el-table>
 
           <!--工具条-->
@@ -227,7 +243,7 @@
       </div>
     </div>
     <el-dialog
-      title="同步飞书费用报销单据"
+      title="同步飞书支付申请单据"
       :visible.sync="showSyncFeiShuDialog"
       width="400px"
       :before-close="handleClose"
@@ -253,6 +269,183 @@
         >
       </span>
     </el-dialog>
+
+    详情查看弹出框
+    <el-dialog
+      title="支付申请单详情"
+      :visible.sync="detailDialog"
+      width="1100px"
+      :before-close="handleClose"
+    >
+      <div ref="printContent" class="printContent">
+        <div class="printContent-detail">
+          <div class="detail-item">
+            <span class="detail-item-title">
+              <span class="printBox">{{ "单据编号" }}</span>
+            </span>
+            <span class="detail-item-content">
+              <span>{{ paymentDetail.code }}</span>
+            </span>
+          </div>
+          <div class="detail-item">
+            <span class="detail-item-title"
+              ><span class="printBox">{{ "项目编号" }}</span></span
+            >
+            <span class="detail-item-content">{{
+              paymentDetail.projectCode
+            }}</span>
+          </div>
+          <div class="detail-item">
+            <span class="detail-item-title"
+              ><span class="printBox">{{ "项目名称" }}</span></span
+            >
+            <span class="detail-item-content">{{
+              paymentDetail.projectName
+            }}</span>
+          </div>
+          <div class="detail-item">
+            <span class="detail-item-title"
+              ><span class="printBox">{{ "提交人所属部门" }}</span></span
+            >
+            <span class="detail-item-content">{{
+              paymentDetail.submitterDept
+            }}</span>
+          </div>
+          <div class="detail-item">
+            <span class="detail-item-title"
+              ><span class="printBox">{{ "提交人" }}</span></span
+            >
+            <span class="detail-item-content">{{
+              paymentDetail.submitterName
+            }}</span>
+          </div>
+          <div class="detail-item">
+            <span class="detail-item-title"
+              ><span class="printBox">{{ "付款方式" }}</span></span
+            >
+            <span class="detail-item-content">{{
+              paymentDetail.paymentMethod
+            }}</span>
+          </div>
+          <div class="detail-item">
+            <span class="detail-item-title"
+              ><span class="printBox">{{ "付款日期" }}</span></span
+            >
+            <span class="detail-item-content">{{
+              paymentDetail.paymentDate
+            }}</span>
+          </div>
+          <div class="detail-item">
+            <span class="detail-item-title"
+              ><span class="printBox">{{ "付款金额" }}</span></span
+            >
+            <span class="detail-item-content">{{
+              paymentDetail.paymentAmount
+            }}</span>
+          </div>
+          <div class="detail-item">
+            <span class="detail-item-title"
+              ><span class="printBox">{{ "银行账户" }}</span></span
+            >
+            <span class="detail-item-content">{{
+              paymentDetail.bankAccount
+            }}</span>
+          </div>
+          <div class="detail-item" style="width: 100%">
+            <span class="detail-item-title" style="width: 100%"
+              ><span class="printBox">{{ "付款事由" }}</span></span
+            >
+            <span class="detail-item-content" style="width: 100%">{{
+              paymentDetail.paymentReason
+            }}</span>
+          </div>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="print()">{{ $t("daYin") }}</el-button>
+        <el-button @click="detailDialog = false">{{ $t("guanBi") }}</el-button>
+      </span>
+    </el-dialog>
+
+    <el-dialog
+      title="编辑支付申请单"
+      v-if="editDialog"
+      :visible.sync="editDialog"
+      customClass="customWidth"
+      width="550px"
+      append-to-body
+    >
+      <el-form
+        label-width="120px"
+        :rules="paymentDetailRules"
+        ref="paymentDetail"
+        :model="paymentDetail"
+      >
+        <el-form-item label="单据编号:" prop="code">
+          <el-input v-model="paymentDetail.code" disabled></el-input>
+        </el-form-item>
+        <el-form-item label="项目编号:" prop="projectCode">
+          <el-input v-model="paymentDetail.projectCode" disabled></el-input>
+        </el-form-item>
+        <el-form-item label="项目名称:" prop="projectName">
+          <el-select
+            filterable
+            placeholder="请选择项目"
+            v-model="paymentDetail.projectId"
+            style="width: 100%"
+            @change="handleChange"
+          >
+            <el-option
+              v-for="item in projectList"
+              :label="item.projectName"
+              :value="item.id"
+            >
+              {{ item.projectName + " / " + item.projectCode }}
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="提交人所属部门:" prop="submitterDept">
+          <el-input v-model="paymentDetail.submitterDept" disabled></el-input>
+        </el-form-item>
+        <el-form-item label="付款事由:" prop="paymentReason">
+          <el-input v-model="paymentDetail.paymentReason"></el-input>
+        </el-form-item>
+        <el-form-item label="付款方式:" prop="paymentMethod">
+          <el-input v-model="paymentDetail.paymentMethod"></el-input>
+        </el-form-item>
+        <el-form-item label="付款日期:" prop="paymentDate">
+          <!-- <el-input v-model="paymentDetail.paymentDate"></el-input> -->
+          <el-date-picker
+            v-model="paymentDetail.paymentDate"
+            value-format="yyyy-MM-dd"
+            type="date"
+            placeholder="选择日期"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="付款金额:" prop="paymentAmount">
+          <el-input-number
+            v-model="paymentDetail.paymentAmount"
+            :precision="2"
+            :step="0.1"
+          ></el-input-number>
+        </el-form-item>
+        <el-form-item label="银行账户:" prop="bankAccount">
+          <el-input v-model="paymentDetail.bankAccount"></el-input>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="editDialog = false" size="medium">{{
+          $t("btn.cancel")
+        }}</el-button>
+        <el-button
+          type="primary"
+          @click="paymentEditSure('paymentDetail')"
+          size="medium"
+          >{{ $t("btn.determine") }}</el-button
+        >
+      </span>
+    </el-dialog>
   </section>
 </template>
 
@@ -350,7 +543,7 @@ export default {
       usersNoInfo: [], // 人员信息,去掉自己
       displayTable: true,
       getLists: [],
-      ProjectList: [], // 项目列表
+      projectList: [], // 项目列表
       companyId: [], // 人员的id
       dialogVisible: false,
       projectCode: null,
@@ -451,6 +644,16 @@ export default {
       equipmentOwnerList: [],
       equipmentOwnertextVisable: false,
       equipmentOwnerValue: { equipmentOwner: "" },
+      paymentDetail: {}, // 单据详情
+      editDialog: false,
+      paymentDetailRules: {
+        projectName: [
+          { required: true, message: "请选择项目", trigger: "change" },
+        ],
+        paymentAmount: [
+          { required: true, message: "请输入付款金额", trigger: "change" },
+        ],
+      },
     };
   },
   computed: {
@@ -500,6 +703,12 @@ export default {
     },
   },
   methods: {
+    // 单据查看
+    downloadByA(val) {
+      this.detailDialog = true;
+      this.flg = true;
+      this.getParticulars(val.id);
+    },
     startSync() {
       if (!this.syncYmonth) {
         this.$message({ message: "请选择需要同步的月份", type: "error" });
@@ -1145,29 +1354,11 @@ export default {
         },
       );
     },
-    // 单据查看
-    downloadByA(val) {
-      if (val.status == 0) {
-        this.detailDialog = true;
-        this.modifyRemarkVisible = false;
-      } else {
-        this.dialog = true;
-      }
-      console.log(val, "看看数据来源");
-      this.detaExpenseMainTypeName = val.expenseMainTypeName;
-      this.flg = true;
-      this.getParticulars(val.id);
-      this.expenseTypeList = this.allExpList.filter(
-        (a) => a.mainType == val.type,
-      );
-    },
     // 单据编辑
     showEditName(val) {
-      (this.dialog = true), (this.flg = false), delete val.invoiceList;
+      (this.editDialog = true), (this.flg = false), delete val.invoiceList;
       this.getParticulars(val.id);
-      this.expenseTypeList = this.allExpList.filter(
-        (a) => a.mainType == val.type,
-      );
+      this.getProjectList();
     },
     staffs(key, keyPath) {
       // 控制员工费用报表
@@ -1491,6 +1682,61 @@ export default {
         },
       );
     },
+    //changeProject
+    handleChange(value) {
+      console.log(value, "<== changeProject");
+      this.paymentDetail.projectCode = this.projectList.filter(
+        (p) => p.id == value,
+      )[0].projectCode;
+      this.paymentDetail.projectName = this.projectList.filter(
+        (p) => p.id == value,
+      )[0].projectName;
+    },
+    paymentEditSure(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          let parameter = {
+            id: this.paymentDetail.id,
+            projectId: this.paymentDetail.projectId,
+            projectCode: this.paymentDetail.projectCode,
+            projectName: this.paymentDetail.projectName,
+            paymentAmount: this.paymentDetail.paymentAmount,
+            paymentDate: this.paymentDetail.paymentDate,
+            paymentMethod: this.paymentDetail.paymentMethod,
+            paymentReason: this.paymentDetail.paymentReason,
+            bankAccount: this.paymentDetail.bankAccount,
+          };
+          this.http.JSONPost(
+            "/payment-application/edit",
+            parameter,
+            (res) => {
+              if (res.code == "ok") {
+                this.editDialog = false;
+                this.getList();
+                this.$message({
+                  message: this.$t("editsuccess"),
+                  type: "success",
+                });
+              } else {
+                this.$message({
+                  message: res.msg,
+                  type: "error",
+                });
+              }
+            },
+            (error) => {
+              this.$message({
+                message: error,
+                type: "error",
+              });
+            },
+          );
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
     //获取单据列表
     getList() {
       // console.log(this.date)
@@ -1538,43 +1784,16 @@ export default {
     // 获取查看单据的数据
     getParticulars(id) {
       this.http.post(
-        "/expense-sheet/getDetail",
+        "/payment-application/getDetail",
         {
           id: id,
-          projectId: this.selectProject ? this.selectProject : "",
         },
         (res) => {
           if (res.code == "ok") {
             // this
             console.log(res, "<=== 详情数据");
-            // this.ParticularsList = res.data
-            // this.expenseMainTypeValue = res.data.type
             var s = [];
-            // var b = []
-            for (var i in res.data.invoiceList) {
-              if (res.data.invoiceList[i].pic) {
-                let newPic = res.data.invoiceList[i].pic.split(",");
-                res.data.invoiceList[i].pic = newPic.map((item) => {
-                  return {
-                    name: item,
-                    url: `/upload/${item}`,
-                    // url: `http://47.101.180.183/upload/${item}`,
-                    title: this.$t("expensereimbursementvoucher"),
-                  };
-                });
-              }
-            }
-            this.ParticularsList = res.data;
-            for (
-              var i = 0;
-              i <= this.ParticularsList.invoiceList.length - 1;
-              i++
-            ) {
-              s.push(this.ParticularsList.invoiceList[i].projectId);
-            }
-            this.projectIdName = this.projectList.filter((item) => {
-              return s.indexOf(item.id) !== -1;
-            });
+            this.paymentDetail = res.data;
             // this.projectIdName = this.projectList.filter(p => p.id == this.ParticularsList.invoiceList[0].projectId)[0].projectName
             // console.log(res.data, '查看当前状态');
             // console.log(this.ParticularsList)
@@ -1614,7 +1833,7 @@ export default {
         },
       ).then(() => {
         this.http.post(
-          "/expense-sheet/delete",
+          "/payment-application/delete",
           { id: item.id },
           (res) => {
             if (res.code == "ok") {