lsw 11 ヶ月 前
コミット
ebe26b3914

+ 97 - 89
admin-ui/src/views/work/project/index.vue

@@ -30,24 +30,24 @@
     <el-table :data="response.rows" border @selection-change="selects" height="calc(100vh - 270px)">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="项目名称" align="left" prop="projectName" width="230" />
-      <el-table-column label="项目编号" align="center" prop="num" />
+      <el-table-column label="项目编号" align="center" prop="num" width="180" />
       <el-table-column label="项目周期" align="center" width="200">
         <template slot-scope="scope">
           <span>{{ scope.row.startDate }} 至 {{ scope.row.finishDate }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="服务公司" align="center" width="150">
+      <el-table-column label="服务公司" align="center" width="180">
         <template slot-scope="scope">
           <div class="omit" :title="scope.row.serviceCompany">{{ scope.row.serviceCompany }}</div>
         </template>
       </el-table-column>
-      <el-table-column label="接包人数" align="center" prop="peoples" width="110">
+      <el-table-column label="接包人数" align="center" prop="peoples" width="120">
         <template slot-scope="scope">
           <div class="omit">{{ scope.row.peoples || 0 }}</div>
         </template>
       </el-table-column>
-      <el-table-column label="发包日期" align="center" prop="createTime" />
-      <el-table-column label="项目状态" align="center" prop="state" width="100">
+      <el-table-column label="发包日期" align="center" prop="createTime" width="160" />
+      <el-table-column label="项目状态" align="center" prop="state" width="100" fixed="right">
         <template slot-scope="scope">
           <div class="switch">
             <el-switch v-model="scope.row.state" :active-value="0" :width="50" :inactive-value="1" @change="op('change', scope.row)"></el-switch>
@@ -56,9 +56,10 @@
           </div>
         </template>
       </el-table-column>
-      <el-table-column label="操作" align="center" width="270" fixed="right">
+      <el-table-column label="操作" align="center" width="370" fixed="right">
         <template slot-scope="scope">
           <el-button size="mini" type="text" icon="el-icon-s-goods" @click="op('packages', scope.row)" v-hasPermi="['work:project:list']">接包明细</el-button>
+          <el-button size="mini" type="text" icon="el-icon-document-copy" @click="op('generate', scope.row)" v-hasPermi="['work:statement:make']">生成结算单</el-button>
           <el-button size="mini" type="text" icon="el-icon-view" @click="op('detail', scope.row)" v-hasPermi="['work:project:list']">详情</el-button>
           <el-button size="mini" type="text" icon="el-icon-edit" @click="op('edit', scope.row)" v-hasPermi="['work:project:edit']">修改</el-button>
           <el-button size="mini" type="text" icon="el-icon-delete" @click="del(scope.row)" v-hasPermi="['work:project:remove']">删除</el-button>
@@ -73,93 +74,100 @@
 </template>
 
 <script>
-import edit from './edit';
-import packages from './packages/index.vue';
-export default {
-  name: 'Project',
-  data() {
-    return {
-      ids: [],
-      showSearch: true,
-      response: {},
-      dateRange: [],
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        projectName: null,
-        num: null,
-        state: null,
-        orderByColumn: 'id',
-        isAsc: 'desc'
-      }
-    };
-  },
-  created() {
-    this.getList();
-  },
-  methods: {
-    getList() {
-      if (this.dateRange) {
-        this.queryParams.dateBegin = this.dateRange[0];
-        this.queryParams.dateEnd = this.dateRange[1];
-      }
-      this.ajax({ url: '/work/project/list', data: this.queryParams }).then((response) => {
-        this.response = response;
-      });
+  import edit from './edit';
+  import packages from './packages/index.vue';
+  export default {
+    name: 'Project',
+    data() {
+      return {
+        ids: [],
+        showSearch: true,
+        response: {},
+        dateRange: [],
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
+          projectName: null,
+          num: null,
+          state: null,
+          orderByColumn: 'id',
+          isAsc: 'desc'
+        }
+      };
     },
-    handleQuery() {
-      this.queryParams.pageNum = 1;
+    created() {
       this.getList();
     },
-    resetQuery() {
-      this.resetForm('queryForm');
-      this.dateRange = [];
-      this.handleQuery();
-    },
-    selects(rows) {
-      this.ids = rows.map((item) => item.id);
-    },
-    op(tag, row) {
-      if (tag == 'add') {
-        this.iframe({ obj: edit, param: {}, title: '新增项目', width: '50%', height: '50%' });
-        return;
-      }
-      const id = row.id || this.ids[0];
-      if (tag == 'packages') {
-        this.iframe({ obj: packages, param: { projectId: row.id }, title: '接包明细', width: '75%', height: '75%' });
-      }
-      if (tag == 'detail') {
-        this.iframe({ obj: edit, param: { id: id, detail: true }, title: '项目详情', width: '55%', height: '55%' });
-      }
-      if (tag == 'edit') {
-        this.iframe({ obj: edit, param: { id: id }, title: '编辑项目', width: '55%', height: '55%' });
-      }
-      //账号状态
-      if (tag == 'change') {
-        let text = row.state === 0 ? '发布' : '停用';
-        this.$confirm('确认要' + text + '该项目吗?', '警告', { type: 'warning' })
-          .then(() => {
-            this.post({ url: '/work/project/edit', data: { id: row.id, state: row.state } })
-              .then((response) => {
-                this.$modal.msgSuccess(text + '成功');
-              })
-              .catch(() => {
-                row.state = row.state === 0 ? 1 : 0;
-              });
-          })
-          .catch(() => {
-            row.state = row.state === 0 ? 1 : 0;
+    methods: {
+      getList() {
+        if (this.dateRange) {
+          this.queryParams.dateBegin = this.dateRange[0];
+          this.queryParams.dateEnd = this.dateRange[1];
+        }
+        this.ajax({ url: '/work/project/list', data: this.queryParams }).then((response) => {
+          this.response = response;
+        });
+      },
+      handleQuery() {
+        this.queryParams.pageNum = 1;
+        this.getList();
+      },
+      resetQuery() {
+        this.resetForm('queryForm');
+        this.dateRange = [];
+        this.handleQuery();
+      },
+      selects(rows) {
+        this.ids = rows.map((item) => item.id);
+      },
+      op(tag, row) {
+        if (tag == 'add') {
+          this.iframe({ obj: edit, param: {}, title: '新增项目', width: '50%', height: '50%' });
+          return;
+        }
+        const id = row.id || this.ids[0];
+        if (tag == 'packages') {
+          this.iframe({ obj: packages, param: { projectId: row.id }, title: '接包明细', width: '75%', height: '75%' });
+        }
+        if (tag == 'detail') {
+          this.iframe({ obj: edit, param: { id: id, detail: true }, title: '项目详情', width: '55%', height: '55%' });
+        }
+        if (tag == 'edit') {
+          this.iframe({ obj: edit, param: { id: id }, title: '编辑项目', width: '55%', height: '55%' });
+        }
+        //账号状态
+        if (tag == 'change') {
+          let text = row.state === 0 ? '发布' : '停用';
+          this.$confirm('确认要' + text + '该项目吗?', '警告', { type: 'warning' })
+            .then(() => {
+              this.post({ url: '/work/project/edit', data: { id: row.id, state: row.state } })
+                .then((response) => {
+                  this.$modal.msgSuccess(text + '成功');
+                })
+                .catch(() => {
+                  row.state = row.state === 0 ? 1 : 0;
+                });
+            })
+            .catch(() => {
+              row.state = row.state === 0 ? 1 : 0;
+            });
+        }
+        if (tag == 'generate') {
+          this.$confirm('是否确认生成结算单!', '警告', { type: 'warning' }).then(() => {
+            this.get({ url: 'work/statement/make/generate/project/' + row.id }).then((response) => {
+              this.$modal.msgSuccess('生成成功');
+            });
+          });
+        }
+      },
+      del(row) {
+        this.$confirm('是否确认删除选中项目? 会影响已经接包用户!', '警告', { type: 'warning' }).then(() => {
+          this.get({ url: '/work/project/remove/' + (row.id || this.ids) }).then((response) => {
+            this.$modal.msgSuccess('删除成功');
+            this.getList();
           });
-      }
-    },
-    del(row) {
-      this.$confirm('是否确认删除选中项目? 会影响已经接包用户!', '警告', { type: 'warning' }).then(() => {
-        this.get({ url: '/work/project/remove/' + (row.id || this.ids) }).then((response) => {
-          this.$modal.msgSuccess('删除成功');
-          this.getList();
         });
-      });
+      }
     }
-  }
-};
+  };
 </script>

+ 93 - 82
admin-ui/src/views/work/project/packages/index.vue

@@ -14,14 +14,16 @@
         <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
       </el-form-item>
-      <el-button type="primary" icon="el-icon-download" @click="handleExport" style="float: right">导出</el-button>
+      <el-button type="primary" icon="el-icon-download" @click="handleExport" style="float: right">导出成结算单</el-button>
     </el-form>
     <el-table :data="response.rows" border>
       <el-table-column type="index" label="序号" align="center" width="70" />
       <el-table-column label="姓名" align="center" prop="name" width="100" />
-      <el-table-column label="身份证" align="center" prop="idCard" />
+      <el-table-column label="身份证" align="center" prop="idCard" width="180" />
       <el-table-column label="手机号" align="center" prop="phone" width="120" />
-      <el-table-column label="支付宝账号" align="center" prop="alipay" />
+      <el-table-column label="开户行" align="center" prop="bankName" width="150" />
+      <el-table-column label="银行卡号" align="center" prop="bankAccount" width="200" />
+      <el-table-column label="支付宝账号" align="center" prop="alipay" width="120" />
       <el-table-column label="接包凭证" align="center" width="130">
         <template slot-scope="scope">
           <el-tag type="danger" v-if="scope.row.audit == 0">待上传</el-tag>
@@ -38,12 +40,13 @@
         </template>
       </el-table-column>
       <el-table-column label="接包日期" align="center" prop="createTime" width="160" />
-      <el-table-column label="操作" align="center" width="250">
+      <el-table-column label="操作" align="center" width="250" fixed="right">
         <template slot-scope="scope">
           <el-button size="mini" type="text" icon="el-icon-document" @click="op('contract', scope.row)">查看合同</el-button>
           <el-button size="mini" type="text" icon="el-icon-check" @click="op('success', scope.row)" v-if="scope.row.audit == 1">确认</el-button>
           <el-button size="mini" type="text" icon="el-icon-close" @click="op('reject', scope.row)" v-if="scope.row.audit == 1">驳回</el-button>
           <el-button size="mini" type="text" icon="el-icon-view" @click="op('detail', scope.row)">详情</el-button>
+          <el-button size="mini" type="text" icon="el-icon-delete" @click="del(scope.row)">删除</el-button>
         </template>
       </el-table-column>
       <template slot="empty">
@@ -55,93 +58,101 @@
 </template>
 
 <script>
-import contract from '@/views/work/user/contract';
-import info from '@/views/work/user/edit';
-export default {
-  name: 'Packages',
-  data() {
-    return {
-      response: {},
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        projectId: null,
-        name: null,
-        phone: null,
-        idCard: null,
-        orderByColumn: 'p.id',
-        isAsc: 'desc'
-      }
-    };
-  },
-  props: {
-    param: {
-      type: Object,
-      default: () => {
-        return {};
-      }
+  import contract from '@/views/work/user/contract';
+  import info from '@/views/work/user/edit';
+  export default {
+    name: 'Packages',
+    data() {
+      return {
+        response: {},
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
+          projectId: null,
+          name: null,
+          phone: null,
+          idCard: null,
+          orderByColumn: 'p.id',
+          isAsc: 'desc'
+        }
+      };
     },
-    layerid: {
-      type: String
-    }
-  },
-  mounted() {
-    this.queryParams.projectId = this.param.projectId;
-    this.getList();
-  },
-  methods: {
-    getList() {
-      this.ajax({ url: '/work/packages/list', data: this.queryParams }).then((response) => {
-        this.response = response;
-      });
+    props: {
+      param: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      },
+      layerid: {
+        type: String
+      }
     },
-    handleQuery() {
-      this.queryParams.pageNum = 1;
+    mounted() {
+      this.queryParams.projectId = this.param.projectId;
       this.getList();
     },
-    resetQuery() {
-      this.resetForm('queryForm');
-      this.handleQuery();
-    },
-    op(tag, row) {
-      const id = row.id;
-      if (tag == 'detail') {
-        this.iframe({ obj: info, param: { id: row.userId, detail: true }, title: '查看详情', width: '55%', height: '65%' });
-      }
-      if (tag == 'success') {
-        this.$confirm('是否确认审核通过?', '警告', { type: 'warning' }).then(() => {
-          this.ajax({ url: '/work/packages/success/' + id }).then((response) => {
-            this.$modal.msgSuccess('审核成功');
-            this.getList();
-          });
+    methods: {
+      getList() {
+        this.ajax({ url: '/work/packages/list', data: this.queryParams }).then((response) => {
+          this.response = response;
         });
-      }
-      if (tag == 'reject') {
-        this.$prompt('确定审核驳回', {
-          type: 'warning',
-          showInput: true,
-          inputType: 'textarea',
-          inputPlaceholder: '驳回原因',
-          inputValidator: (value) => {
-            if (!value) {
-              return '请输入驳回原因';
+      },
+      handleQuery() {
+        this.queryParams.pageNum = 1;
+        this.getList();
+      },
+      resetQuery() {
+        this.resetForm('queryForm');
+        this.handleQuery();
+      },
+      op(tag, row) {
+        const id = row.id;
+        if (tag == 'detail') {
+          this.iframe({ obj: info, param: { id: row.userId, detail: true }, title: '查看详情', width: '55%', height: '65%' });
+        }
+        if (tag == 'success') {
+          this.$confirm('是否确认审核通过?', '警告', { type: 'warning' }).then(() => {
+            this.ajax({ url: '/work/packages/success/' + id }).then((response) => {
+              this.$modal.msgSuccess('审核成功');
+              this.getList();
+            });
+          });
+        }
+        if (tag == 'reject') {
+          this.$prompt('确定审核驳回', {
+            type: 'warning',
+            showInput: true,
+            inputType: 'textarea',
+            inputPlaceholder: '驳回原因',
+            inputValidator: (value) => {
+              if (!value) {
+                return '请输入驳回原因';
+              }
             }
-          }
-        }).then(({ value }) => {
-          this.ajax({ method: 'post', url: '/work/packages/reject', data: { id: id, msg: value } }).then((response) => {
-            this.$modal.msgSuccess('驳回成功');
+          }).then(({ value }) => {
+            this.ajax({ method: 'post', url: '/work/packages/reject', data: { id: id, msg: value } }).then((response) => {
+              this.$modal.msgSuccess('驳回成功');
+              this.getList();
+            });
+          });
+        }
+        if (tag == 'contract') {
+          this.iframe({ obj: contract, param: { id: row.userId }, title: '查看合同', width: '55%', height: '85%' });
+        }
+      },
+      del(row) {
+        this.$confirm('是否确认删除选中接包用户!', '警告', { type: 'warning' }).then(() => {
+          this.get({ url: '/work/packages/remove/' + row.id }).then((response) => {
+            this.$modal.msgSuccess('删除成功');
             this.getList();
           });
         });
+      },
+      /** 导出按钮操作 */
+      handleExport() {
+        this.download('/work/packages/export', { ...this.queryParams }, '结算单.xlsx');
       }
-      if (tag == 'contract') {
-        this.iframe({ obj: contract, param: { id: row.userId }, title: '查看合同', width: '55%', height: '85%' });
-      }
-    },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download('/work/packages/export', { ...this.queryParams }, '接包用户明细.xlsx');
     }
-  }
-};
+  };
 </script>

+ 63 - 62
admin-ui/src/views/work/statement/make/index.vue

@@ -33,7 +33,8 @@
       <el-table-column label="创建日期" align="center" prop="createTime" width="170" />
       <el-table-column label="操作" align="center" width="270">
         <template slot-scope="scope">
-          <el-button size="mini" type="text" icon="el-icon-view" @click="op('detail', scope.row)">详情</el-button>
+          <el-button size="mini" type="text" icon="el-icon-edit" @click="op('edit', scope.row)" v-if="scope.row.state === 0">编辑</el-button>
+          <el-button size="mini" type="text" icon="el-icon-view" @click="op('detail', scope.row)" v-else>详情</el-button>
           <el-button size="mini" type="text" icon="el-icon-check" @click="op('generate', scope.row)" v-if="scope.row.state === 0">生成结算单</el-button>
           <el-button size="mini" type="text" icon="el-icon-delete" @click="del(scope.row)" v-if="scope.row.state === 0">删除</el-button>
         </template>
@@ -47,73 +48,73 @@
 </template>
 
 <script>
-import edit from './edit';
-import record from './record';
-export default {
-  data() {
-    return {
-      showSearch: true,
-      response: {},
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        batchName: null,
-        projectId: null,
-        orderByColumn: 's.id',
-        isAsc: 'desc'
-      }
-    };
-  },
-  created() {
-    this.getList();
-  },
-  methods: {
-    getList() {
-      this.ajax({ url: '/work/statement/make', data: this.queryParams }).then((response) => {
-        this.response = response;
-      });
+  import edit from './edit';
+  import record from './record';
+  export default {
+    data() {
+      return {
+        showSearch: true,
+        response: {},
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
+          batchName: null,
+          projectId: null,
+          orderByColumn: 's.id',
+          isAsc: 'desc'
+        }
+      };
     },
-    handleQuery() {
-      this.queryParams.pageNum = 1;
+    created() {
       this.getList();
     },
-    resetQuery() {
-      this.resetForm('queryForm');
-      this.handleQuery();
-    },
-    op(tag, row) {
-      if (tag == 'add') {
-        this.iframe({ obj: edit, param: {}, title: '创建结算单', width: '40%', height: '63%' });
-        return;
-      }
-      if (tag == 'download') {
-        this.download('work/statement/make/download', {}, '结算单模版.xlsx');
-        return;
-      }
-      const id = row.id;
-      if (tag == 'detail') {
-        this.iframe({ obj: record, param: { id: id, detail: true }, title: '查看结算单明细', width: '65%', height: '70%' });
-      }
-      if (tag == 'edit') {
-        this.iframe({ obj: record, param: { id: id }, title: '编辑结算单', width: '65%', height: '65%' });
-      }
-      if (tag == 'generate') {
-        this.$confirm('是否确认生成结算单?', '警告', { type: 'warning' }).then(() => {
-          this.ajax({ url: '/work/statement/make/generate/' + id }).then((response) => {
-            this.$modal.msgSuccess('生成成功');
+    methods: {
+      getList() {
+        this.ajax({ url: '/work/statement/make', data: this.queryParams }).then((response) => {
+          this.response = response;
+        });
+      },
+      handleQuery() {
+        this.queryParams.pageNum = 1;
+        this.getList();
+      },
+      resetQuery() {
+        this.resetForm('queryForm');
+        this.handleQuery();
+      },
+      op(tag, row) {
+        if (tag == 'add') {
+          this.iframe({ obj: edit, param: {}, title: '手动创建结算单', width: '40%', height: '63%' });
+          return;
+        }
+        if (tag == 'download') {
+          this.download('work/statement/make/download', {}, '结算单模版.xlsx');
+          return;
+        }
+        const id = row.id;
+        if (tag == 'detail') {
+          this.iframe({ obj: record, param: { form: row, detail: true }, title: '查看结算单明细', width: '65%', height: '70%' });
+        }
+        if (tag == 'edit') {
+          this.iframe({ obj: record, param: { form: row }, title: '编辑结算单', width: '65%', height: '70%' });
+        }
+        if (tag == 'generate') {
+          this.$confirm('是否确认生成结算单?', '警告', { type: 'warning' }).then(() => {
+            this.ajax({ url: '/work/statement/make/generate/' + id }).then((response) => {
+              this.$modal.msgSuccess('生成成功');
+              this.getList();
+            });
+          });
+        }
+      },
+      del(row) {
+        this.$confirm('是否确认删除选中数据?', '警告', { type: 'warning' }).then(() => {
+          this.get({ url: '/work/statement/make/remove/' + row.id }).then((response) => {
+            this.$modal.msgSuccess('删除成功');
             this.getList();
           });
         });
       }
-    },
-    del(row) {
-      this.$confirm('是否确认删除选中数据?', '警告', { type: 'warning' }).then(() => {
-        this.get({ url: '/work/statement/make/remove/' + row.id }).then((response) => {
-          this.$modal.msgSuccess('删除成功');
-          this.getList();
-        });
-      });
     }
-  }
-};
+  };
 </script>

+ 64 - 55
admin-ui/src/views/work/statement/make/record.vue

@@ -17,13 +17,17 @@
     </el-form>
     <el-table :data="response.rows" border>
       <el-table-column type="index" label="序号" align="center" width="80" />
-      <el-table-column label="姓名" align="center" prop="name" width="90"/>
-      <el-table-column label="身份证号" align="center" prop="idCard"/>
-      <el-table-column label="手机号" align="center" prop="phone" width="120"/>
-      <el-table-column label="支付宝" align="center" prop="alipay" />
-      <el-table-column label="开户行" align="center" prop="bankName" />
+      <el-table-column label="姓名" align="center" prop="name" width="90" />
+      <el-table-column label="身份证号" align="center" prop="idCard" />
+      <el-table-column label="手机号" align="center" prop="phone" width="125" />
+      <el-table-column label="支付宝" align="center" prop="alipay" width="125" />
+      <el-table-column label="开户行" align="center" prop="bankName" width="120" />
       <el-table-column label="银行卡号" align="center" prop="bankAccount" />
-      <el-table-column label="结算金额(元)" align="center" prop="money" width="110" />
+      <el-table-column label="结算金额(元)" align="center" prop="money" width="145">
+        <template slot-scope="scope">
+          <el-input type="number" v-model="scope.row.money" placeholder="输入金额" @blur="blur(scope.row)" clearable />
+        </template>
+      </el-table-column>
       <template slot="empty">
         <el-empty></el-empty>
       </template>
@@ -32,58 +36,63 @@
   </div>
 </template>
 <script>
-export default {
-  data() {
-    return {
-      ids: [],
-      showSearch: true,
-      response: {},
-      dateRange: [],
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        name: null,
-        phone: null,
-        idCard: null,
-        orderByColumn: 'id',
-        isAsc: 'desc'
-      }
-    };
-  },
-  props: {
-    param: {
-      type: Object,
-      default: () => {
-        return {};
-      }
+  export default {
+    data() {
+      return {
+        ids: [],
+        showSearch: true,
+        response: {},
+        dateRange: [],
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
+          name: null,
+          phone: null,
+          idCard: null,
+          orderByColumn: 'id',
+          isAsc: 'desc'
+        }
+      };
     },
-    layerid: {
-      type: String
-    }
-  },
-  created() {
-    this.queryParams.statementId = this.param.id;
-    this.getList();
-  },
-  methods: {
-    getList() {
-      this.ajax({ url: '/work/statement/detailList', data: this.queryParams }).then((response) => {
-        this.response = response;
-      });
+    props: {
+      param: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      },
+      layerid: {
+        type: String
+      }
     },
-    handleQuery() {
-      this.queryParams.pageNum = 1;
+    created() {
+      this.queryParams.statementId = this.param.form.id;
       this.getList();
     },
-    resetQuery() {
-      this.resetForm('queryForm');
-      this.dateRange = [];
-      this.handleQuery();
-    },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download('/work/recharge/export', { ...this.queryParams }, '充值明细.xlsx');
+    methods: {
+      getList() {
+        this.ajax({ url: '/work/statement/detailList', data: this.queryParams }).then((response) => {
+          this.response = response;
+        });
+      },
+      handleQuery() {
+        this.queryParams.pageNum = 1;
+        this.getList();
+      },
+      resetQuery() {
+        this.resetForm('queryForm');
+        this.dateRange = [];
+        this.handleQuery();
+      },
+      blur(row) {
+        this.ajax({ method: 'post', url: '/work/statement/make/money/edit', data: { id: row.id, money: row.money } }).then((response) => {
+          this.$modal.msgSuccess('编辑成功');
+        });
+      },
+      /** 导出按钮操作 */
+      handleExport() {
+        this.download('/work/recharge/export', { ...this.queryParams }, '充值明细.xlsx');
+      }
     }
-  }
-};
+  };
 </script>

+ 7 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/PackagesController.java

@@ -53,6 +53,13 @@ public class PackagesController extends BaseController {
         return packagesService.reject(dto);
     }
 
+    @PreAuthorize("@ss.hasPermi('work:packages:list')")
+    @Log(title = "删除接包用户", businessType = BusinessType.DELETE)
+    @GetMapping("/remove/{id}")
+    public AjaxResult remove(@PathVariable Long id) throws ServerException {
+        return packagesService.remove(id);
+    }
+
     @Log(title = "导出接包用户信息", businessType = BusinessType.EXPORT)
     @PreAuthorize("@ss.hasPermi('work:packages:list')")
     @PostMapping("/export")

+ 16 - 6
ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/StatementController.java

@@ -8,10 +8,7 @@ import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.web.work.domain.Statement;
 import com.ruoyi.web.work.domain.StatementDetail;
-import com.ruoyi.web.work.domain.dto.RejectDto;
-import com.ruoyi.web.work.domain.dto.SmsDto;
-import com.ruoyi.web.work.domain.dto.StatementDto;
-import com.ruoyi.web.work.domain.dto.StatementExportDto;
+import com.ruoyi.web.work.domain.dto.*;
 import com.ruoyi.web.work.domain.vo.StatementExportListVo;
 import com.ruoyi.web.work.service.ICommonService;
 import com.ruoyi.web.work.service.IStatementDetailService;
@@ -136,7 +133,7 @@ public class StatementController extends BaseController {
     @PreAuthorize("@ss.hasPermi('work:statement:export')")
     @Log(title = "平台导出网银助手表单", businessType = BusinessType.EXPORT)
     @PostMapping("/pay/export")
-    public void payExport(HttpServletResponse response, @Validated StatementExportDto dto){
+    public void payExport(HttpServletResponse response, @Validated StatementExportDto dto) {
         List<StatementExportListVo> list = statementService.exportList(dto);
         ExcelUtil<StatementExportListVo> util = new ExcelUtil<StatementExportListVo>(StatementExportListVo.class);
         util.exportExcel(response, list, "网银助手表单");
@@ -199,12 +196,18 @@ public class StatementController extends BaseController {
     }
 
     @PreAuthorize("@ss.hasPermi('work:statement:make')")
-    @Log(title = "生成结算单", businessType = BusinessType.UPDATE)
+    @Log(title = "生成结算单(手动)", businessType = BusinessType.UPDATE)
     @GetMapping("/make/generate/{id}")
     public AjaxResult makeGenerate(@PathVariable("id") Long id) {
         return statementService.makeGenerate(id);
     }
 
+    @PreAuthorize("@ss.hasPermi('work:statement:make')")
+    @Log(title = "生成结算单(自动)", businessType = BusinessType.UPDATE)
+    @GetMapping("/make/generate/project/{id}")
+    public AjaxResult makeGenerateByProject(@PathVariable("id") Long id) {
+        return statementService.makeGenerateByProject(id);
+    }
 
     @PreAuthorize("@ss.hasAnyPermi('system:user:add,work:statement:give')")
     @GetMapping(value = "/detail/{id}")
@@ -223,6 +226,13 @@ public class StatementController extends BaseController {
     }
 
     @PreAuthorize("@ss.hasPermi('work:statement:make')")
+    @Log(title = "编辑结算单明细金额", businessType = BusinessType.UPDATE)
+    @PostMapping("/make/money/edit")
+    public AjaxResult makeMoneyEdit(@Validated @RequestBody MoneyDto dto){
+        return statementService.makeMoneyEdit(dto);
+    }
+
+    @PreAuthorize("@ss.hasPermi('work:statement:make')")
     @Log(title = "删除结算单", businessType = BusinessType.DELETE)
     @GetMapping("/make/remove/{id}")
     public AjaxResult makeRemove(@PathVariable Long id) {

+ 13 - 8
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/Packages.java

@@ -10,6 +10,7 @@ import lombok.Data;
 import lombok.experimental.Accessors;
 
 import javax.validation.constraints.NotNull;
+import java.math.BigDecimal;
 import java.util.Date;
 
 /**
@@ -32,7 +33,6 @@ public class Packages {
     private Long projectId;
 
     @TableField(exist = false)
-    @Excel(name = "服务项目", width = 30)
     private String projectName;
 
     @NotNull(message = "参数错误")
@@ -67,30 +67,35 @@ public class Packages {
     private String name;
 
     @TableField(exist = false)
+    @ApiModelProperty(value = "身份证")
+    @Excel(name = "身份证号",width =35)
+    private String idCard;
+
+    @TableField(exist = false)
     @ApiModelProperty(value = "手机号")
     @Excel(name = "手机号")
     private String phone;
 
     @TableField(exist = false)
-    @ApiModelProperty(value = "身份证")
-    @Excel(name = "身份证", width = 30)
-    private String idCard;
+    @ApiModelProperty(value = "支付宝")
+    @Excel(name = "支付宝")
+    private String alipay;
 
     @TableField(exist = false)
     @ApiModelProperty(value = "开户行")
+    @Excel(name = "开户行")
     private String bankName;
 
     @TableField(exist = false)
     @ApiModelProperty(value = "银行卡账号")
+    @Excel(name = "银行卡号",width =30)
     private String bankAccount;
 
     @TableField(exist = false)
-    @ApiModelProperty(value = "支付宝")
-    @Excel(name = "支付宝")
-    private String alipay;
+    @Excel(name = "金额(元)")
+    private BigDecimal money;
 
     @TableField(fill = FieldFill.INSERT)
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @Excel(name = "接包时间", dateFormat = "yyyy-MM-dd HH:mm:ss", width = 30)
     private Date createTime;
 }

+ 19 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/dto/MoneyDto.java

@@ -0,0 +1,19 @@
+package com.ruoyi.web.work.domain.dto;
+
+import lombok.Data;
+
+import javax.validation.constraints.DecimalMin;
+import javax.validation.constraints.NotNull;
+import java.math.BigDecimal;
+
+@Data
+public class MoneyDto {
+
+
+    @NotNull(message = "参数错误")
+    private Long id;
+
+    @NotNull(message = "金额不能为空")
+    @DecimalMin(value = "1", inclusive = false, message = "金额不能小于1")
+    private BigDecimal money;
+}

+ 2 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IPackagesService.java

@@ -26,4 +26,6 @@ public interface IPackagesService extends IService<Packages>{
     AjaxResult success(Long id) throws ServerException;
 
     AjaxResult reject(RejectDto dto) throws ServerException;
+
+    AjaxResult remove(Long id) throws ServerException;
 }

+ 16 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IStatementService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.web.work.domain.Statement;
 import com.ruoyi.web.work.domain.StatementDetail;
+import com.ruoyi.web.work.domain.dto.MoneyDto;
 import com.ruoyi.web.work.domain.dto.RejectDto;
 import com.ruoyi.web.work.domain.dto.StatementDto;
 import com.ruoyi.web.work.domain.dto.StatementExportDto;
@@ -46,6 +47,21 @@ public interface IStatementService extends IService<Statement> {
      */
     AjaxResult makeGenerate(Long id);
 
+    /**
+     * 点击项目生成结算单
+     *
+     * @param id
+     * @return
+     */
+    AjaxResult makeGenerateByProject(Long id);
+
+
+    /**
+     * 编辑结算单明细金额
+     * @param dto
+     * @return
+     */
+    AjaxResult makeMoneyEdit(MoneyDto dto);
 
     /**
      * 提交结算单审核

+ 16 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/PackagesServiceImpl.java

@@ -3,6 +3,7 @@ package com.ruoyi.web.work.service.impl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.web.work.api.util.AppUtil;
 import com.ruoyi.web.work.domain.Packages;
 import com.ruoyi.web.work.domain.Project;
@@ -52,6 +53,9 @@ public class PackagesServiceImpl extends ServiceImpl<PackagesMapper, Packages> i
         if (user.getIsContract() == 0) {
             return AjaxResult.error("请先签约");
         }
+        if (StringUtils.isEmpty(user.getBankName()) || StringUtils.isEmpty(user.getBankAccount())) {
+            return AjaxResult.error("请先在我的->个人信息那里完善收款信息");
+        }
         Project project = projectService.getById(packages.getProjectId());
         if (project == null || project.getState() == 1) {
             return AjaxResult.error("项目不存在或被停用");
@@ -121,4 +125,16 @@ public class PackagesServiceImpl extends ServiceImpl<PackagesMapper, Packages> i
         }
         return AjaxResult.success();
     }
+
+    @Override
+    public AjaxResult remove(Long id) throws ServerException {
+        Packages packages = getById(id);
+        if (packages == null || !packages.getCompanyId().equals(SecurityUtils.getLoginUser().getUser().getCompanyId())) {
+            return AjaxResult.error("当前接包不存在或非法操作");
+        }
+        if (!removeById(id)) {
+            throw new ServerException("更新接包失败,请联系平台");
+        }
+        return AjaxResult.success();
+    }
 }

+ 77 - 4
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/StatementServiceImpl.java

@@ -9,6 +9,7 @@ import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.bean.BeanValidators;
 import com.ruoyi.web.work.domain.*;
+import com.ruoyi.web.work.domain.dto.MoneyDto;
 import com.ruoyi.web.work.domain.dto.RejectDto;
 import com.ruoyi.web.work.domain.dto.StatementDto;
 import com.ruoyi.web.work.domain.dto.StatementExportDto;
@@ -23,6 +24,7 @@ import org.springframework.transaction.annotation.Transactional;
 import javax.validation.Validator;
 import java.math.BigDecimal;
 import java.rmi.ServerException;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
@@ -56,6 +58,12 @@ public class StatementServiceImpl extends ServiceImpl<StatementMapper, Statement
     @Autowired
     private IRecordService recordService;
 
+    @Autowired
+    private IProjectService projectService;
+
+    @Autowired
+    private IPackagesService packagesService;
+
     @Override
     public List<Statement> selectList(Statement statement) {
         return statementMapper.selectList(statement);
@@ -107,10 +115,6 @@ public class StatementServiceImpl extends ServiceImpl<StatementMapper, Statement
             detail.setNum(StringUtils.generateNumber());
             detail.setServiceMoney(platform.getRate().divide(new BigDecimal("100")).multiply(detail.getMoney()));
             detail.setRealMoney(detail.getMoney().subtract(detail.getServiceMoney()));
-            StatementDetail check = statementDetailMapper.check(detail);
-            if (check != null) {
-                throw new ServiceException("导入失败,身份证为:" + detail.getIdCard() + " 的数据已存在");
-            }
             if (!detailService.save(detail)) {
                 throw new ServiceException("导入失败,请联系平台");
             }
@@ -137,6 +141,75 @@ public class StatementServiceImpl extends ServiceImpl<StatementMapper, Statement
         return AjaxResult.success();
     }
 
+    @Transactional
+    @Override
+    public AjaxResult makeGenerateByProject(Long id) {
+        Project project = projectService.getById(id);
+        if (project == null || !project.getCompanyId().equals(SecurityUtils.getLoginUser().getUser().getCompanyId())) {
+            return AjaxResult.error("项目不存在或非法操作");
+        }
+        if (project.getState() == 1) {
+            return AjaxResult.error("项目已停用");
+        }
+        Packages packages = new Packages();
+        packages.setProjectId(project.getId());
+        packages.setCompanyId(SecurityUtils.getLoginUser().getUser().getCompanyId());
+        List<Packages> packagesList = packagesService.selectList(packages);
+        if (packagesList.isEmpty() || packagesList.size() == 0) {
+            return AjaxResult.error("该项目暂无人接包,无法生成结算单");
+        }
+        Platform platform = redisCache.getCacheObject(CacheConstants.APP_PLATFORM);
+        Statement statement = new Statement();
+        statement.setFileName("自动生成");
+        statement.setProjectId(project.getId());
+        statement.setChannel("银行卡转账");
+        statement.setInvoice("增值税全额发票");
+        statement.setUserId(SecurityUtils.getLoginUser().getUser().getUserId());
+        statement.setCompanyId(SecurityUtils.getLoginUser().getUser().getCompanyId());
+        statement.setOpBy(SecurityUtils.getLoginUser().getUser().getNickName());
+        statement.setState(0);
+        statement.setGive(0);
+        statement.setAudit(0);
+        statement.setMoney(BigDecimal.ZERO);
+        statement.setServiceCompany(platform.getServiceCompany());
+        if (!save(statement)) {
+            throw new ServiceException("创建结算单失败,请联系平台");
+        }
+        List<StatementDetail> list = new ArrayList<>();
+        packagesList.forEach(e -> {
+            StatementDetail detail = new StatementDetail();
+            detail.setName(e.getName());
+            detail.setIdCard(e.getIdCard());
+            detail.setBankName(e.getBankName());
+            detail.setAlipay(e.getAlipay());
+            detail.setPhone(e.getPhone());
+            detail.setBankAccount(e.getBankAccount());
+            detail.setStatementId(statement.getId());
+            detail.setProjectId(project.getId());
+            detail.setState(0);
+            detail.setCompanyId(statement.getCompanyId());
+            detail.setNum(StringUtils.generateNumber());
+            list.add(detail);
+        });
+        if (!detailService.saveBatch(list)) {
+            throw new ServiceException("生成结算单失败,请联系平台");
+        }
+        return AjaxResult.success();
+    }
+
+    @Override
+    public AjaxResult makeMoneyEdit(MoneyDto dto) {
+        StatementDetail detail = detailService.getById(dto.getId());
+        if (detail == null || !detail.getCompanyId().equals(SecurityUtils.getLoginUser().getUser().getCompanyId())) {
+            return AjaxResult.error("关联结算单不存在或非法操作");
+        }
+        detail.setMoney(dto.getMoney());
+        if (!detailService.updateById(detail)) {
+            throw new ServiceException("编辑金额失败");
+        }
+        return AjaxResult.success();
+    }
+
     @Override
     public AjaxResult manageSubmit(Long id) {
         Statement statement = getById(id);

+ 2 - 0
ruoyi-admin/src/main/resources/mapper/work/StatementMapper.xml

@@ -9,6 +9,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             s.id,
             s.company_id,
             s.num,
+            s.channel,
+            s.invoice,
             s.state,
             s.audit,
             s.give,