yuedefeng %!s(int64=6) %!d(string=hai) anos
pai
achega
098771cebf

+ 1 - 0
src/dashoo.cn/backend/api/business/paymentinfo/paymentinfo.go

@@ -33,4 +33,5 @@ type PaymentinfoList struct {
 	SupplierTypeCode string
 	SupplierTypeName string
 	SupplierName     string
+	CommercialNo     string
 }

+ 6 - 2
src/dashoo.cn/backend/api/business/paymentinfo/paymentinfoService.go

@@ -20,9 +20,13 @@ func GetPaymentService(xormEngine *xorm.Engine) *PaymentService {
 func (s *PaymentService) GetPaymentinfoList(pageIndex, itemsPerPage int64, order string, asc string, entitiesPtr interface{}, where string) (total int64) {
 	var err error
 	var resultsSlice []map[string][]byte
-	sqlconunt := "SELECT COUNT(Id) FROM OilPaymentInfo WHERE IsPay = '1' "
+	sqlconunt := "SELECT count(*) " +
+		"FROM OilPaymentInfo p " +
+		"LEFT JOIN OilSupplier s ON p.SupplierId = s.Id " +
+		"LEFT JOIN OilSupplierCert c ON p.SupplierCertId = c.Id " +
+		"WHERE "+ where
 
-	sql := "SELECT c.SupplierTypeCode,c.SupplierTypeName,s.SupplierName,p.* " +
+	sql := "SELECT c.SupplierTypeCode,c.SupplierTypeName,s.SupplierName,s.CommercialNo,p.* " +
 		"FROM OilPaymentInfo p " +
 		"LEFT JOIN OilSupplier s ON p.SupplierId = s.Id " +
 		"LEFT JOIN OilSupplierCert c ON p.SupplierCertId = c.Id " +

+ 5 - 3
src/dashoo.cn/backend/api/controllers/oilsupplier/paymentinfo.go

@@ -65,7 +65,7 @@ func (this *PaymentInfoController) GetEntityList() {
 	sql := " UserName='" + this.User.Username + "'"
 	svcPerm.GetEntity(&registerUser, sql)
 
-	isauth := svcPerm.IsAuthorized(this.User.Id, "oil_supplier.marketAccess.AllRecord")
+	isauth := svcPerm.IsAuthorized(this.User.Id, "oil_supplier.PaymentInfo.AllRecord")
 	if !svcPerm.IsAdmin(this.User.Id) && !isauth {
 
 		where = where + " and (p.CreateUserId = '" + this.User.Id + "' or s.CommercialNo='" + registerUser.CommercialNo + "') "
@@ -554,11 +554,13 @@ func (this *PaymentInfoController) DeleteEntity() {
 		this.ServeJSON()
 		return
 	}
+	var emptyModel paymentinfo.OilPaymentInfo
 	var model paymentinfo.OilPaymentInfo
 	svc := paymentinfo.GetPaymentService(utils.DBE)
 	svc.GetEntityById(Id, &model)
-	where := "Id=" + Id
-	err := svc.DeleteEntityBytbl(OilPaymentInfoName, where)
+	// where := "Id=" + Id
+	// err := svc.DeleteEntityBytbl(OilPaymentInfoName, where)
+	err := svc.DeleteEntityAndBackup(Id, &model, &emptyModel, utils.ToStr(this.User.Id), this.User.Username)
 
 	if err != nil {
 		errinfo.Message = "删除失败!"

+ 15 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/supplier.go

@@ -2104,6 +2104,21 @@ func (this *OilSupplierController) GetEntityListInterface () {
 	}
 }
 
+// @Title 获取实体
+// @Description 获取实体
+// @Success 200 {object} supplier.OilSupplier
+// @router /getentitybycommercialno/:commercialNo [get]
+func (this *OilSupplierController) GetEntityByCommercialNo() {
+	commercialNo := this.Ctx.Input.Param(":commercialNo")
+	where := "CommercialNo = '" + commercialNo + "'"
+
+	var model supplier.OilSupplier
+	svc := supplier.GetOilSupplierService(utils.DBE)
+	svc.GetEntityByWhere(OilSupplierName, where, &model)
+
+	this.Data["json"] = &model
+	this.ServeJSON()
+}
 
 
 

+ 6 - 0
src/dashoo.cn/frontend_web/src/api/oilsupplier/supplier.js

@@ -154,5 +154,11 @@ export default {
       url: '/supplier/getjurisdiction',
       method: 'GET'
     })
+  },
+  getEntityByCommercialNo (commercialNo, myAxios) {
+    return myAxios({
+      url: '/supplier/getentitybycommercialno/' + commercialNo,
+      method: 'GET'
+    })
   }
 }

+ 2 - 3
src/dashoo.cn/frontend_web/src/pages/oilsupplier/paymentinfo/_opera/operation.vue

@@ -13,9 +13,8 @@
           <el-button type="primary" size="mini" style="margin-right: 15px" v-if="formData.IsPay == '1'" @click="printBtn" >打印</el-button>
           <!--<el-button type="primary" size="mini" style="margin-right: 15px" @click="submitPay" v-if="formData.IsPay == '1'">提交缴费</el-button>-->
           <el-button type="primary" size="mini" style="margin-right: 15px" @click="updateEntity" v-if="formData.IsPay == '0' && authUser.Profile.IsCompanyUser!=1 "><i class="el-icon-circle-check"></i>保存</el-button>
-          <router-link :to="'/oilsupplier/paymentinfo'">
-            <el-button type="info" size="mini">返回</el-button>
-          </router-link>
+
+          <el-button type="plain" plain size="mini" @click="$router.back()">返回</el-button>
         </span>
       </div>
       <el-form ref="EntityForm" :model="formData" label-width="120px">

+ 77 - 33
src/dashoo.cn/frontend_web/src/pages/oilsupplier/paymentinfo/icbclist.vue

@@ -1,41 +1,45 @@
 <template>
   <div>
-    <el-breadcrumb class="heading">
+    <!--<el-breadcrumb class="heading">
       <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
       <el-breadcrumb-item>银行账单</el-breadcrumb-item>
-    </el-breadcrumb>
+    </el-breadcrumb>-->
     <el-card class="box-card">
       <div slot="header">
         <span>
-          <i class="icon icon-table2"></i> 供应商账单
+          <i class="icon icon-table2"></i> 财务收款
         </span>
-        <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
-          <el-form-item label="组织机构代码">
-            <el-input v-model="searchForm.commercialNo" size="small" placeholder="请输入" style="width: 100%"></el-input>
-          </el-form-item>
+      </div>
 
-          <el-form-item>
-            <el-button type="primary" size="mini" icon="el-icon-search" @click="handleSearch">获取账单</el-button>
+      <el-row>
+        <el-col>
+          <el-form ref="form" :inline="true">
+            <el-form-item label="">
+              <el-input v-model="searchForm.commercialNo" placeholder="组织机构代码" style="width: 300px"></el-input>
+            </el-form-item>
 
-            <!--<el-button type="warning" size="mini" icon="el-icon-search" @click="handleCheckBill">对账功能</el-button>-->
-          </el-form-item>
-        </el-form>
-      </div>
+            <el-form-item>
+              <el-button type="plain" plain icon="el-icon-search" @click="handleSearch">获取账单</el-button>
+              <el-button type="primary" icon="el-icon-money" @click="handleGetMoneyConfirm">确认收款</el-button>
+              <!--<el-button type="warning" size="mini" icon="el-icon-search" @click="handleCheckBill">对账功能</el-button>-->
+            </el-form-item>
+          </el-form>
+        </el-col>
 
-      <el-form label-width="120px" :inline="true">
-        <el-form-item label="企业名称">
-          <span>{{getSupplierName()}}</span>
-        </el-form-item>
-        <el-form-item label="组织机构代码">
-          <span>{{getUSCCode()}}</span>
-        </el-form-item>
-        <el-form-item label="缴费总金额">
-          <span style="font-weight: bold; color: red;">{{amountSum()}} 元</span>
-        </el-form-item>
-        <el-form-item label="">
-          <el-button type="primary" icon="el-icon-money" @click="handleGetMoney">收款成功</el-button>
-        </el-form-item>
-      </el-form>
+        <el-col>
+          <el-form label-width="120px" :inline="true">
+            <el-form-item label="企业名称">
+              <span>{{supplierEntity.SupplierName}}</span>
+            </el-form-item>
+            <el-form-item label="组织机构代码">
+              <span>{{supplierEntity.CommercialNo}}</span>
+            </el-form-item>
+            <el-form-item label="缴费总金额">
+              <span style="font-weight: bold; color: red;">{{amountSum()}} 元</span>
+            </el-form-item>
+          </el-form>
+        </el-col>
+      </el-row>
     </el-card>
     <el-card class="box-card" style="height: calc(100vh - 115px);">
       <el-table :data="entityList" size="mini" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
@@ -63,6 +67,7 @@
     mapGetters
   } from 'vuex'
   import api from '@/api/oilsupplier/paymentinfo'
+  import apiSupplier from '@/api/oilsupplier/supplier'
 
   export default {
     computed: {
@@ -79,6 +84,7 @@
         // 列表数据
         selectsupplierlist: [],
         entityList: [],
+        supplierEntity: [],
         // 分页参数
         size: 10,
         currentPage: 1,
@@ -124,9 +130,7 @@
           commercialNo: this.searchForm.commercialNo
         }
         // 访问接口
-        console.log(params)
         api.getBillListbc(params, this.$axios).then(res => {
-          console.log(res)
           this.entityList = res.data.items
           this.currentItemCount = res.data.currentItemCount
         }).catch(err => {
@@ -185,6 +189,38 @@
           rnd+=Math.floor(Math.random()*10);
         return rnd;
       },
+      handleGetMoneyConfirm() {
+        let idlist = ''
+        let sumMoeny = 0.0
+        for (let idx in this.entityList) {
+          idlist += this.entityList[idx].Id + ','
+          sumMoeny += this.entityList[idx].Amount + 0.0
+        }
+        if (idlist.length <= 0) {
+          this.$message({
+            type: 'warning',
+            message: '请先获取账单,再确认收款'
+          })
+          return
+        }
+        if (sumMoeny <= 0) {
+          this.$confirm('账单总金额小于等于0, 是否继续确认收款?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            this.handleGetMoney()
+          })
+        } else {
+          this.$confirm('确认收款吗?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'info'
+          }).then(() => {
+            this.handleGetMoney()
+          })
+        }
+      },
       handleGetMoney () {
         let idlist = ''
         let sumMoeny = 0.0
@@ -256,8 +292,16 @@
       handleSearch () {
         this.currentPage = 1
         this.dialogVisible = false
+        this.showSupplierInfo()
         this.initDatas()
       },
+      showSupplierInfo () {
+        apiSupplier.getEntityByCommercialNo(this.searchForm.commercialNo, this.$axios).then(res => {
+          this.supplierEntity = res.data
+        }).catch(err => {
+          console.error(err)
+        })
+      },
       handleCheckBill () {
         let params = {
           startTime: new Date('2019-1-1'),
@@ -330,13 +374,13 @@
         return y + '-' + m + '-' + d + ' ' + h + ':' + minute
       },
       amountSum () {
-        var s = 0
-        if (this.entityList || this.entityList != null) {
-          for (var i = this.entityList.length - 1; i >= 0; i--) {
+        let s = 0
+        if (this.entityList && this.entityList != null) {
+          for (let i = this.entityList.length - 1; i >= 0; i--) {
             s += parseInt(this.entityList[i].Amount)
           }
-          return s
         }
+        return s
       },
       getUSCCode () {
         if (this.entityList != null && this.entityList.length > 0) {

+ 26 - 13
src/dashoo.cn/frontend_web/src/pages/oilsupplier/paymentinfo/index.vue

@@ -9,7 +9,7 @@
         <span>
           <i class="icon icon-table2"></i> 缴费信息列表
         </span>
-        <el-button type="primary" size="mini" style="float: right;margin-top: -3px;margin-left: 15px" @click="addpayinfo" v-if="authUser.Profile.IsCompanyUser != '1'">添加缴费信息</el-button>
+        <el-button type="primary" size="mini" style="float: right;margin-top: -3px;margin-left: 15px" v-if="authUser.Profile.IsCompanyUser != '1'" @click="addpayinfo">添加缴费信息</el-button>
         <el-form ref="form" :inline="true" style="float: right; margin-top: -10px;">
           <!--<el-form-item label="缴费日期">-->
             <!--<el-date-picker size="mini" style="width: 220px" v-model="CreateOn" type="daterange" range-separator="至"-->
@@ -44,20 +44,14 @@
             <router-link :to="'/oilsupplier/paymentinfo/' + scope.row.Id + '/operation'">
               <el-button type="primary" plain title="查看详情" size="mini">查看</el-button>
             </router-link>
-            <el-popover placement="top" title="提示" trigger="click">
-              <el-alert title="" description="确认要删除吗?" type="warning" :closable="false">
-              </el-alert>
-              <br />
-              <div style="text-align: right; margin: 0">
-                <el-button type="primary" size="mini" @click="deleteEntity(scope.row)">删除</el-button>
-              </div>
-              <el-button slot="reference" plain type="danger" title="删除" style="margin-left:10px"
-                         size="mini">删除</el-button>
-            </el-popover>
+
+            <el-button v-if="authUser.Profile.IsCompanyUser != '1'" plain type="plain" title="删除" style="margin-left:10px"
+                       size="mini" @click="deleteEntityConfirm(scope.row)">删除</el-button>
           </template>
         </el-table-column>
 
         <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="SupplierName" label="企业名称"></el-table-column>
+        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="CommercialNo" label="组织机构代码"></el-table-column>
         <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="SupplierTypeName" label="项目类型"></el-table-column>
         <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="PayType" label="缴费类型">
           <template slot-scope="scope">
@@ -66,6 +60,13 @@
         </el-table-column>
         <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="Amount" label="缴费金额">
         </el-table-column>
+        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="IsPay" label="状态">
+          <template slot-scope="scope">
+            <span style="color: yellowgreen" v-if="scope.row.IsPay == 0">待确认</span>
+            <span style="color: #00bcd4"  v-if="scope.row.IsPay == 1">待缴费</span>
+            <span style="color: green"  v-if="scope.row.IsPay == 2">已缴费</span>
+          </template>
+        </el-table-column>
       </el-table>
       <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
                      :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
@@ -255,6 +256,7 @@
               type: 'success',
               message: res.data.message
             })
+            this.initDatas()
           } else {
             this.$message({
               type: 'warning',
@@ -273,7 +275,6 @@
           Prop: this.Column.Prop
         }
         supapi.getList('', params, this.$axios).then(res => {
-          console.log(res)
           this.supplierOptions = res.data.items
         }).catch(err => {
           console.error(err)
@@ -367,6 +368,15 @@
         this.currentPage = 1
         this.initDatas()
       },
+      deleteEntityConfirm (row) {
+        this.$confirm('确定要删除吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.deleteEntity(row)
+        })
+      },
       deleteEntity (row) {
         api.deleteEntity(row.Id, this.$axios).then(res => {
           if (res.data.code === 0) {
@@ -422,5 +432,8 @@
 </script>
 
 <style lang="scss">
-
+  .el-pagination {
+    margin: 1rem 0 2rem;
+    text-align: right;
+  }
 </style>

+ 6 - 2
src/dashoo.cn/frontend_web/src/pages/oilsupplier/paymentinfo/paymented.vue

@@ -46,6 +46,7 @@
         </el-table-column>
 
         <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="SupplierName" label="企业名称"></el-table-column>
+        <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="CommercialNo" label="组织机构代码"></el-table-column>
         <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="SupplierTypeName" label="项目类型"></el-table-column>
         <el-table-column sortable min-width="120" align="center" show-overflow-tooltip prop="PayType" label="缴费类型">
           <template slot-scope="scope">
@@ -201,8 +202,8 @@
         // 查询条件
         Object.assign(params, this.searchForm)
         // 访问接口
-        console.log(params)
         api.getList(myCreateOn.join(','), params, this.$axios).then(res => {
+          console.log(res)
           this.entityList = res.data.items
           this.currentItemCount = res.data.currentItemCount
         }).catch(err => {
@@ -325,5 +326,8 @@
 </script>
 
 <style lang="scss">
-
+  .el-pagination {
+    margin: 1rem 0 2rem;
+    text-align: right;
+  }
 </style>

+ 35 - 13
src/dashoo.cn/frontend_web/src/pages/oilsupplier/paymentinfo/paymentsure.vue

@@ -11,26 +11,33 @@
         </span>
         <span style="float: right;">
           <el-button type="primary" size="mini" style="margin-right: 15px" @click="printBtn">打印</el-button>
-          <el-button type="primary" plain title="查看详情" size="mini" v-if="entityList && entityList.length > 0" :loading="sureLoading" @click="BillSureClick">确认缴费单</el-button>
+          <el-button type="primary" plain title="查看详情" size="mini" v-if="entityList && entityList.length > 0" :loading="sureLoading" @click="BillSureClickConfirm">确认缴费单</el-button>
         </span>
       </div>
       <div class="table-layout" style="margin-top: 0px">
         <el-row>
-          <el-col :span="4" class="table-cell-title">单位名称</el-col>
-          <el-col :span="4" class="table-cell-title">税号</el-col>
-          <el-col :span="4" class="table-cell-title">注册地址</el-col>
-           <el-col :span="4" class="table-cell-title">开户银行</el-col>
-          <el-col :span="4" class="table-cell-title">银行账号</el-col>
-          <el-col :span="4" class="table-cell-title">财务电话</el-col>
+          <el-col :span="6" class="table-cell-title">单位名称</el-col>
+          <el-col :span="6" class="table-cell-title">税号</el-col>
+          <el-col :span="12" class="table-cell-title">注册地址</el-col>
         </el-row>
 
         <el-row>
-          <el-col :span="4" class="table-cell">{{this.formDataSup.SupplierName}}</el-col>
-          <el-col :span="4" class="table-cell">{{this.formDataSup.CommercialNo}}</el-col>
-          <el-col :span="4" class="table-cell">{{this.formDataSup.Address}}</el-col>
-            <el-col :span="4" class="table-cell">{{this.formDataSup.DepositBank}}</el-col>
-          <el-col :span="4" class="table-cell">{{this.formDataSup.BankAccount}}</el-col>
-          <el-col :span="4" class="table-cell">{{this.formDataSup.CompanyTel}}</el-col>
+          <el-col :span="6" class="table-cell">{{this.formDataSup.SupplierName}}</el-col>
+          <el-col :span="6" class="table-cell">{{this.formDataSup.CommercialNo}}</el-col>
+          <el-col :span="12" class="table-cell">{{this.formDataSup.Address}}</el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="6" class="table-cell-title">开户银行</el-col>
+          <el-col :span="6" class="table-cell-title">银行账号</el-col>
+          <el-col :span="6" class="table-cell-title">财务电话</el-col>
+          <el-col :span="6" class="table-cell-title">电子邮箱</el-col>
+        </el-row>
+
+        <el-row>
+          <el-col :span="6" class="table-cell">{{this.formDataSup.DepositBank}}</el-col>
+          <el-col :span="6" class="table-cell">{{this.formDataSup.BankAccount}}</el-col>
+          <el-col :span="6" class="table-cell">{{this.formDataSup.CompanyTel}}</el-col>
+          <el-col :span="6" class="table-cell">{{this.formDataSup.EMail}}</el-col>
         </el-row>
       </div>
     </el-card>
@@ -119,6 +126,12 @@
           <el-col :span="16">
             <div class="table-cell2">{{this.formDataSup.DepositBank}}&nbsp;&nbsp;&nbsp;&nbsp;{{this.formDataSup.BankAccount}}</div>
           </el-col>
+          <el-col :span="8">
+            <div class="table-cell-title2">电子邮箱:</div>
+          </el-col>
+          <el-col :span="16">
+            <div class="table-cell2">{{this.formDataSup.EMail}}&nbsp;</div>
+          </el-col>
         </el-row>
       </div>
       <span slot="footer" class="dialog-footer">
@@ -172,6 +185,15 @@
       printBtn () {
         this.dialogVisible = true
       },
+      BillSureClickConfirm () {
+        this.$confirm('确认后需要去交费, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'info'
+        }).then(() => {
+          this.BillSureClick()
+        })
+      },
       BillSureClick () {
         this.sureLoading = true