lining 6 éve
szülő
commit
6b7e2c398e

+ 8 - 6
src/dashoo.cn/backend/api/business/oilsupplier/oilcostmanage/oilcostmanage.go

@@ -6,14 +6,16 @@ import (
 
 type OilCostManage struct {
 	Id             int       `xorm:"not null pk autoincr INT(10)"`
-	Code           string    `xorm:"not null default 0 comment('缴费项目编码') INT(11)"`
-	Project        string    `xorm:"not null default 0 comment('缴费项目名称') INT(10)"`
-	Amount         float64   `xorm:"comment('金额') VARCHAR(100)"`
-	Remark         string    `xorm:"comment('备注') VARCHAR(500)"`
+	Code           string    `xorm:"comment('缴费项目编码') VARCHAR(100)"`
+	Project        string    `xorm:"comment('缴费项目名称') VARCHAR(100)"`
+	TypeCode       string    `xorm:" VARCHAR(20)"`
+	TypeName       string    `xorm:"comment('物质类 基建类 技术服务类') VARCHAR(50)"`
+	Amount         float64   `xorm:"comment('金额') FLOAT"`
+	Remark         string    `xorm:"comment('备注') VARCHAR(255)"`
+	CreateUserId   int       `xorm:"INT(11)"`
 	CreateOn       time.Time `xorm:"DATETIME"`
-	CreateUserId   int       `xorm:"INT(10)"`
 	CreateBy       string    `xorm:"VARCHAR(50)"`
 	ModifiedOn     time.Time `xorm:"DATETIME"`
-	ModifiedUserId int       `xorm:"INT(10)"`
+	ModifiedUserId int       `xorm:"INT(11)"`
 	ModifiedBy     string    `xorm:"VARCHAR(50)"`
 }

+ 7 - 0
src/dashoo.cn/backend/api/business/oilsupplier/oilcostmanage/oilcostmanageService.go

@@ -19,3 +19,10 @@ func GetOilCostManageService(xormEngine *xorm.Engine) *OilCostManageService {
 	s.DBE = xormEngine
 	return s
 }
+
+func (s *OilCostManageService) GetAmount(code, typecode string) float64 {
+	entity := new(OilCostManage)
+	sql := "select * from OilCostManage where Code='" + code + "' and TypeCode='" + typecode + "'"
+	s.DBE.Sql(sql).Get(entity)
+	return  entity.Amount
+}

+ 10 - 7
src/dashoo.cn/backend/api/controllers/oilsupplier/annualaudit.go

@@ -5,6 +5,7 @@ import (
 	"dashoo.cn/backend/api/business/baseUser"
 	msg2 "dashoo.cn/backend/api/business/msg"
 	"dashoo.cn/backend/api/business/oilsupplier/infochange"
+	"dashoo.cn/backend/api/business/oilsupplier/oilcostmanage"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
 	"dashoo.cn/backend/api/business/organize"
 	"dashoo.cn/backend/api/business/paymentinfo"
@@ -908,13 +909,15 @@ func (this *AnnualAuditController) AnnualAudit() {
 			svc.UpdateEntityByIdCols(list.CerId, certmodel, certcols)
 			paysvc := paymentinfo.GetPaymentService(utils.DBE)
 			var Amount float64
-			if list.SupplierTypeName == "01" {
-				Amount = 6000
-			} else if list.SupplierTypeName == "02" {
-				Amount = 7000
-			} else if list.SupplierTypeName == "03" {
-				Amount = 8000
-			}
+			asvc := oilcostmanage.GetOilCostManageService(utils.DBE)
+			Amount = asvc.GetAmount("APPEND",list.SupplierTypeName)
+			//if list.SupplierTypeName == "01" {
+			//	Amount = 6000
+			//} else if list.SupplierTypeName == "02" {
+			//	Amount = 7000
+			//} else if list.SupplierTypeName == "03" {
+			//	Amount = 8000
+			//}
 			var payinfo paymentinfo.OilPaymentInfo
 			payinfo.SupplierId = list.SupplierId
 			payinfo.SupplierCertId = list.CerId

+ 109 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/oilcostmanage.go

@@ -0,0 +1,109 @@
+package oilsupplier
+
+import (
+	"dashoo.cn/backend/api/business/oilsupplier/oilcostmanage"
+	. "dashoo.cn/backend/api/controllers"
+	"dashoo.cn/utils"
+	"encoding/json"
+	"time"
+)
+
+type OilCostManageController struct {
+	BaseController
+}
+
+// @Title
+// @Description get user by token
+// @Success 200 {object} oilcostmanage.OilCostManage
+// @router /list [get]
+func (this *OilCostManageController) GetList() {
+	page := this.GetPageInfoForm()
+	var list []oilcostmanage.OilCostManage
+	svc := oilcostmanage.GetOilCostManageService(utils.DBE)
+	where := " 1=1"
+	orderby := "Id"
+	asc := true
+	Order := this.GetString("Order")
+	Prop := this.GetString("Prop")
+	if Order != "" && Prop != "" {
+		orderby = Prop
+		if Order == "asc" {
+			asc = true
+		}
+	}
+
+	total := svc.GetPagingEntitiesWithoutAccCode(page.CurrentPage, page.Size, orderby, asc, &list, where)
+	var datainfo DataInfo
+	datainfo.Items = list
+	datainfo.CurrentItemCount = total
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
+
+// @Title 修改
+// @Description 修改实体
+// @Success	200	{object} controllers.Request
+// @router /update/:id [post]
+func (this *OilCostManageController) Update() {
+	id := this.Ctx.Input.Param(":id")
+	var errinfo ErrorInfo
+	if id == "" {
+		errinfo.Message = "操作失败!请求信息不完整"
+		errinfo.Code = -2
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+
+	var model oilcostmanage.OilCostManage
+	svcCert := oilcostmanage.GetOilCostManageService(utils.DBE)
+
+	var jsonBlob = this.Ctx.Input.RequestBody
+	json.Unmarshal(jsonBlob, &model)
+
+	model.ModifiedOn = time.Now()
+	model.ModifiedBy = this.User.Realname
+	model.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
+
+	colcerts := []string{
+		"Amount",
+		"Remark",
+		"ModifiedOn",
+		"ModifiedBy",
+		"ModifiedUserId",
+	}
+
+	_,err := svcCert.UpdateEntityByIdCols(id, &model, colcerts)
+
+	if err == nil {
+		errinfo.Message = "保存成功!"
+		errinfo.Code = 0
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	} else {
+		errinfo.Message = "保存失败!" + utils.AlertProcess(err.Error())
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	}
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

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

@@ -82,7 +82,7 @@ func (this *PaymentInfoController) GetBillList() {
 
 	var supplierEntity supplier.OilSupplier
 	supplierSvc := supplier.GetOilSupplierService(utils.DBE)
-	supplierWhere := "1=1 and CommercialNo='" + icbcBillQueryParam.CommercialNo + "'"
+	supplierWhere := "1=1 and CommercialNo='" + icbcBillQueryParam.CommercialNo + "'" //  IsPay=1
 	supplierSvc.DBE.Where(supplierWhere).Get(&supplierEntity)
 
 	var billList []paymentinfo.OilPaymentInfo
@@ -291,7 +291,7 @@ func (this *PaymentInfoController) ReceiveMoneyBillList() {
 	json.Unmarshal(jsonBlob, &billParams)
 
 	strIds := strings.Trim(billParams.Ids, ",")
-	sqlList := " 1= 1 and Id in (" + strIds + ") and IsPay = '1'"
+	sqlList := "id in (" + strIds + ") and IsPay = '1'"
 	var paymentInfos []paymentinfo.OilPaymentInfo
 	svc.GetEntities(&paymentInfos, sqlList)
 

+ 10 - 7
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercert.go

@@ -4,6 +4,7 @@ import (
 	msg2 "dashoo.cn/backend/api/business/msg"
 	"dashoo.cn/backend/api/business/audithistory"
 	"dashoo.cn/backend/api/business/codecsequence"
+	"dashoo.cn/backend/api/business/oilsupplier/oilcostmanage"
 	"dashoo.cn/backend/api/business/oilsupplier/supplier"
 	"dashoo.cn/backend/api/business/organize"
 	"dashoo.cn/backend/api/business/paymentinfo"
@@ -977,13 +978,15 @@ func (this *OilSupplierCertController) AuditEntityFir() {
 				if supplierCertEntity.InStyle == "1" {
 					paysvc := paymentinfo.GetPaymentService(utils.DBE)
 					var Amount float64
-					if supplierCertEntity.SupplierTypeCode == suppliercert.DOOGS_TYPECODE {
-						Amount = 6000
-					} else if supplierCertEntity.SupplierTypeCode == suppliercert.BASIS_TYPECODE {
-						Amount = 7000
-					} else if supplierCertEntity.SupplierTypeCode == suppliercert.TECH_TYPECODE {
-						Amount = 8000
-					}
+					asvc := oilcostmanage.GetOilCostManageService(utils.DBE)
+					Amount = asvc.GetAmount("ZHUNRU",supplierCertEntity.SupplierTypeCode)
+					//if supplierCertEntity.SupplierTypeCode == suppliercert.DOOGS_TYPECODE {
+					//	Amount = 6000
+					//} else if supplierCertEntity.SupplierTypeCode == suppliercert.BASIS_TYPECODE {
+					//	Amount = 7000
+					//} else if supplierCertEntity.SupplierTypeCode == suppliercert.TECH_TYPECODE {
+					//	Amount = 8000
+					//}
 					var payinfo paymentinfo.OilPaymentInfo
 					payinfo.SupplierId = supplierCertEntity.SupplierId
 					payinfo.SupplierCertId = supplierCertEntity.Id

+ 10 - 7
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertappend.go

@@ -4,6 +4,7 @@ import (
 	msg2 "dashoo.cn/backend/api/business/msg"
 	"dashoo.cn/backend/api/business/audithistory"
 	"dashoo.cn/backend/api/business/auditsetting"
+	"dashoo.cn/backend/api/business/oilsupplier/oilcostmanage"
 	"dashoo.cn/backend/api/business/oilsupplier/supplier"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercertsub"
 	"dashoo.cn/backend/api/business/organize"
@@ -794,13 +795,15 @@ func (this *OilSupplierCertAppendController) AuditEntityFir() {
 				if supplierCertAppendEntity.InStyle == "1" {
 					paysvc := paymentinfo.GetPaymentService(utils.DBE)
 					var Amount float64
-					if supplierCertAppendEntity.AppendType == "01" {
-						Amount = 6000
-					} else if supplierCertAppendEntity.AppendType == "02" {
-						Amount = 7000
-					} else if supplierCertAppendEntity.AppendType == "03" {
-						Amount = 8000
-					}
+					asvc := oilcostmanage.GetOilCostManageService(utils.DBE)
+					Amount = asvc.GetAmount("APPEND",supplierCertAppendEntity.AppendType)
+					//if supplierCertAppendEntity.AppendType == "01" {
+					//	Amount = 6000
+					//} else if supplierCertAppendEntity.AppendType == "02" {
+					//	Amount = 7000
+					//} else if supplierCertAppendEntity.AppendType == "03" {
+					//	Amount = 8000
+					//}
 					var payinfo paymentinfo.OilPaymentInfo
 					payinfo.SupplierId = supplierCertAppendEntity.SupplierId
 					payinfo.SupplierCertId = supplierCertAppendEntity.SupplierCertId

+ 6 - 0
src/dashoo.cn/backend/api/routers/router.go

@@ -380,6 +380,12 @@ func init() {
 				&oilsupplier.SupplierDataEntryController{},
 			),
 		),
+		// 费用管理
+		beego.NSNamespace("/cost",
+			beego.NSInclude(
+				&oilsupplier.OilCostManageController{},
+			),
+		),
 		//RTX
 		beego.NSNamespace("/rtx",
 			beego.NSInclude(

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

@@ -247,7 +247,7 @@
           Id: '',
           SupplierTypeCode: '',
           SupplierName: '',
-          IsPay: '1',
+          IsPay: '0',
           CreateOn: '',
           CreateUserId: '',
           CreateBy: '',

+ 49 - 674
src/dashoo.cn/frontend_web/src/pages/system/cost.vue

@@ -13,129 +13,57 @@
           <!--<el-button size="mini" type="primary" style="margin-left:10px; margin-top: -4px;" @click="opendatadialog(1,null,-1);resetForm('organizeform')">新增用户</el-button>-->
         </span>
         <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
-          <el-form-item label="收费项目">
-            <el-input size="mini" style="width: 165px;" v-model="searchForm.UserName" placeholder="请输入账号"></el-input>
-          </el-form-item>
-          <el-form-item>
-            <el-dropdown split-button type="primary" size="mini" @click="seachdata" @command="searchCommand">
-              查询
-              <el-dropdown-menu slot="dropdown">
-                <!-- <el-dropdown-item command="search">高级查询</el-dropdown-item> -->
-                <el-dropdown-item command="clear">查询重置</el-dropdown-item>
-              </el-dropdown-menu>
-            </el-dropdown>
-          </el-form-item>
         </el-form>
       </div>
         <el-table :data="list"  size="mini" border>
           <el-table-column label="操作" align="center" fixed="right">
             <template slot-scope="scope">
-              <el-button size="small" @click="opendatadialog(2,scope.row,scope.$index);" type="text" icon="el-icon-edit"
-                title="编辑"></el-button>
+              <el-button size="small" type="text" icon="el-icon-edit"
+                title="编辑" @click="edit(scope.row)"></el-button>
             </template>
           </el-table-column>
-          <el-table-column prop="Username" align="center" label="编码" show-overflow-tooltip></el-table-column>
-          <el-table-column prop="Realname" align="center" label="收费项目"></el-table-column>
-          <el-table-column prop="Departmentname" align="center" label="收费金额"></el-table-column>
-          <el-table-column prop="Unit" align="center" label="单位"></el-table-column>
-          <el-table-column prop="Description" align="center" label="备注"
+          <el-table-column prop="Project" align="center" label="收费项目"></el-table-column>
+          <el-table-column prop="TypeName" align="center" label="类型"></el-table-column>
+          <el-table-column prop="Amount" align="center" label="收费金额"></el-table-column>
+          <el-table-column prop="Remark" align="center" label="备注"
             show-overflow-tooltip></el-table-column>
         </el-table>
     </el-card>
-    <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" :total="currentItemCount">
-    </el-pagination>
-
-    <el-dialog :title="dialogtitle" :visible.sync="datadialogVisible" width="720px">
-      <el-form :model="userform" :rules="rulesuser" ref="userform" label-width="100px">
+    <el-dialog title="编辑" :visible.sync="addshow" width="360px">
+      <el-form label-width="90px" :model="entityForm" ref="EntityFormref">
         <el-row>
           <el-col :span="24">
-            <el-form-item label="账号/Email" prop="username" required>
-              <el-input v-model="userform.username" auto-complete="off" :disabled="disabledserial"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="用户名" required prop="realname">
-              <el-input v-model="userform.realname"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="所属组织" required>
-              <el-cascader :options="orgtreelist" :props="orgtreeprops" change-on-select :show-all-levels="false"
-                v-model="selectedorg" placeholder="请选择组织"></el-cascader>
-            </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="手机" prop="telephone">
-              <el-input v-model="userform.telephone" auto-complete="off"></el-input>
+            <el-form-item label="收费项目">
+              <el-input v-model="entityForm.Project" type="text" readonly>
+              </el-input>
             </el-form-item>
           </el-col>
           <el-col :span="24">
-            <el-form-item label="座机" prop="mobile">
-              <el-input v-model="userform.mobile" auto-complete="off"></el-input>
+            <el-form-item label="类型">
+              <el-input v-model="entityForm.TypeName" type="text" readonly>
+              </el-input>
             </el-form-item>
           </el-col>
           <el-col :span="24">
-            <el-form-item v-if="this.appclient != 'lims'" label="备注">
-              <el-input type="textarea" v-model="userform.description" auto-complete="off"></el-input>
+            <el-form-item label="金额">
+              <el-input v-model="entityForm.Amount" type="text" >
+              </el-input>
             </el-form-item>
           </el-col>
-          <el-col :span="24">
-            <el-form-item v-if=" this.appclient== 'lims'" label="签名">
-              <!-- <el-input type="textarea" v-model="userform.description" auto-complete="off"></el-input> -->
-              <el-upload style="margin-top: 10px;" class="usersignimg-uploader" :action="imghost + '/api/limsupload/usersignimg'"
-                :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
-                <img v-if="imageUrl" :src="imageUrl" class="uploadusersignimg">
-                <i v-else class="el-icon-plus usersignimg-uploader-icon"></i>
-              </el-upload>
+          <el-col :span="25">
+            <el-form-item label="备注">
+              <el-input v-model="entityForm.Remark" type="textarea" >
+              </el-input>
             </el-form-item>
           </el-col>
         </el-row>
       </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="datadialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="savedata('userform')">确 定</el-button>
-      </div>
-    </el-dialog>
-
-
-    <el-dialog :title="rolesettitle" :visible.sync="rolesetVisible">
-      <!-- <el-checkbox :indeterminate="isrolecheckall" v-model="roleCheckAll" @change="handleCheckAllChange">全选</el-checkbox> -->
-      <div style="margin-top:20px;">
-        <el-checkbox-group v-model="selectedrole">
-          <el-checkbox v-for="role in rolelist" @change="handlecheckedrolechange" :label="role.Id" :value="role.Id" :key="role.Id">{{role.Realname}}</el-checkbox>
-        </el-checkbox-group>
-      </div>
-      <div slot="footer">
-        <el-button @click="rolesetVisible = false">取消</el-button>
-        <el-button type="primary" @click="rolesave()">确定</el-button>
-      </div>
-    </el-dialog>
-    <el-dialog :title="permissiondialogtitle" :visible.sync="permissiondatadialogVisible" top="5vh">
-      <el-col :span="6" style="margin-right: 10px">
-        <div class="userpermisstreediv">
-          <el-tree style="border: 0" node-key="id" show-checkbox :data="orgtreelist" :props="orgtreeprops"
-            :default-expanded-keys="userdepartment" @check-change="userpermissorgcheckedchange" ref="userpermisstree">
-          </el-tree>
-        </div>
-      </el-col>
-      <el-col :span="17">
-        <el-form ref="alertform">
-          <el-form-item>
-            <div class="userpermissdiv">
-              <el-checkbox-group v-model="userpermissdevicesselects">
-                <el-checkbox v-for="item in equipdeviceslist" :label="item.Id+''" :key="item.Id">{{item.Code}}</el-checkbox>
-              </el-checkbox-group>
-            </div>
-          </el-form-item>
-        </el-form>
-      </el-col>
-      <div slot="footer" class="dialog-footer" style="margin-top:-35px;">
-        <el-button @click="permissiondatadialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="savepermission()">确 定</el-button>
-      </div>
+      <span style="float: right;margin-top:-10px;">
+          <el-button size="small" @click="addshow = false">取 消</el-button>
+          <el-button type="primary" size="small" @click="saveAmount()">确 定</el-button>
+        </span>
+      <br>
     </el-dialog>
-
   </div>
 </template>
 
@@ -146,616 +74,63 @@
   export default {
     name: 'users',
 
-    data() {
-      var checkusername = (rule, value, callback) => {
-        if (!value) {
-          callback(new Error('请输入账号'))
-        } else {
-          if (this.appclient == 'lims') { //大港油田lims系统不用邮箱
-            callback()
-          }
-          /*let re = /^([a-zA-Z0-9]+[_|-|.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|-|.|-]?)*[a-zA-Z0-9]+.[a-zA-Z]{2,3}$/
-          if (!re.test(value)) {
-            callback(new Error('请输入正确的邮箱地址'))
-          } else {
-            callback()
-          }*/
-          callback()
-        }
-      }
+    data () {
       return {
-        downloading: '',
-        imghost: "",
-        organdialogVisible: false,
-        currentItemCount: 0,
-        currentItemCount2: 0,
-        currentItemCount3: 0,
-        currentPage: 1,
-        size: 10,
-        rolesettitle: '',
-        rolesetVisible: false,
-        roleCheckAll: false,
-        isrolecheckall: false,
-        selectedrole: [],
-        bossSelect: [],
-        list: [],
-        rolelist: [],
-        mustrolelist: [],
-        datadialogVisible: false,
-        dialogtitle: '',
-        disabledserial: false,
-        IsInnerOrganize: 1,
-        appclient: '',
-        userform: {
-          username: '',
-          realname: '',
-          telephone: '',
-          mobile: '',
-          sign: '',
-          description: '',
-          id: 0,
-          departmentid: '',
-          departmentname: '',
-          RealnameRole: '',
-          GroupId: '',
-          GroupName: '',
-          superior: ''
-        },
-        rulesuser: {
-          username: [{
-            validator: checkusername,
-            trigger: 'blur'
-          }],
-          realname: [{
-            required: true,
-            message: '用户名',
-            trigger: 'blur'
-          }]
-        },
-        imageUrl: "",
-        operatingitem: 0,
-        permissiondialogtitle: '',
-        permissiondatadialogVisible: false,
-        isfristchecked: false, // 过滤点击树时出现的多次触发选择事件
-        userpermisstreedata: [], // 组织tree 数据
-        userpermissdevicesselects: [], // 设备批量设置所选设备
-        equipdeviceslist: [], // 批量设置设备设备所有数据
-        equipalllist: [], // 设备所有数据
-        checkedarr: [], // 树形控件多选框
-        orgtreelist: [],
-        orgtreeprops: {
-          value: 'id',
-          label: 'Fullname',
-          children: 'children'
-        },
-        rolelistcheckall: [],
-        selectedorg: [],
-        userdepartment: [],
-        ischeckbj: false, // 过滤字段勾选时触发的选中事件
-        searchForm: {
-          keyword: '',
-          UserName: '',
-          DepartmentName: '',
-          Unit: ''
-        }
+        addshow: false,
+        entityForm: {},
+        list: []
       }
     },
     computed: mapGetters({
       authUser: 'authUser'
     }),
-    created() {
-      this.appclient = process.env.appclient
-      this.imghost = process.env.limsimgserverhost;
-      this.getorgtreelist()
+    created () {
       this.initData()
-      // this.loadequipsall()
-      this.userdepartment.push(parseInt(this.authUser.Profile.DepartmentId))
-      this.selectedorg = [parseInt(this.authUser.Profile.DepartmentId)]
     },
     methods: {
-      setorg2 () {
-        this.$axios.get('users/updatauser2Org')
-          .then(res => {
-          })
-      },
-      initData() {
-        let _this = this
-        // paginate
-        const params = {
-          _currentPage: this.currentPage,
-          _size: this.size,
-          keyword: this.searchForm.keyword,
-          username: this.searchForm.UserName,
-          departmentname: this.searchForm.DepartmentName
-        }
-        Object.assign(params, this.searchForm)
-        // request
-        this.$axios.get('users/list', {
-            params
-          })
+      saveAmount () {
+        this.entityForm.Amount = parseFloat(this.entityForm.Amount)
+        this.$axios.post('/cost/update/' + this.entityForm.Id, this.entityForm)
           .then(res => {
-            // response
-            _this.list = res.data.items
-            _this.currentItemCount = res.data.currentItemCount
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-        this.$axios.get('role/list', {})
-          .then(res => {
-            // response
-            _this.rolelist = res.data.items
-            _this.roleItemCount = res.data.currentItemCount
-            console.log(_this.rolelist, 'rolelist')
-            for (var i = 0; i < _this.roleItemCount; i++) {
-              _this.rolelistcheckall.push(_this.rolelist[i].Id)
-            }
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-      },
-      handleAvatarSuccess(res, file) {
-        this.userform.sign = res
-        this.imageUrl = URL.createObjectURL(file.raw);
-      },
-      beforeAvatarUpload(file) {
-        console.log(file);
-        const isimg = file.type.indexOf("image/") === 0;
-        const isLt50k = file.size / 1024 / 50 < 1;
-        if (!isimg) {
-          this.$message.error("上传图片只能是 图片 格式!");
-          return false;
-        }
-        if (!isLt50k) {
-          this.$message.error("上传图片大小不能超过 50kb!");
-          return false;
-        }
-        return true;
-      },
-      roleset(val) {
-        this.rolesettitle = '用户(' + val.Realname + ')-角色管理'
-        this.rolesetVisible = true
-        this.selecteduserid = val.Id + ''
-        this.selectedrole = []
-        let _this = this
-        // request
-        this.$axios.get('users/getuserrole/' + this.selecteduserid, {})
-          .then(res => {
-            console.log("-------res----",res.data)
-            _this.mustrolelist = []
-            // response
-            for (let i = 0; i < res.data.length; i++) {
-              if (_this.roleisexist(parseInt(res.data[i]))) {
-                _this.selectedrole.push(parseInt(res.data[i]))
-              }
-
-              let flag = false
-              let rdx = 0
-              for (rdx = 0; rdx < _this.rolelist.length; rdx++) {
-                if (parseInt(_this.rolelist[rdx].Id) == parseInt(res.data[i])) {
-                  flag = true;
-                  break;
-                }
-              }
-              if (!flag) {
-                _this.mustrolelist.push(parseInt(res.data[i]))
-              }
-
-            }
-
-            let checkedCount = this.selectedrole.length
-            this.roleCheckAll = checkedCount === this.rolelist.length
-            this.isrolecheckall = checkedCount > 0 && checkedCount < this.rolelist.length
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-      },
-      rolesave() {
-        let _this = this
-        for (let mdx in this.mustrolelist) {
-          if (this.selectedrole.indexOf(this.mustrolelist[mdx]) == -1) {
-            this.selectedrole.push(parseInt(this.mustrolelist[mdx]))
-          }
-        }
-        let rolestring = this.selectedrole.join(',')
-        // request
-        this.$axios.put('users/setuserrole/' + this.selecteduserid + '_' + rolestring, {})
-          .then(res => {
-            // response
             if (res.data.code === 0) {
-              _this.$message({
+              this.$message({
                 type: 'success',
                 message: res.data.message
               })
-              // 更新界面
-              this.list = []
               this.initData()
-              this.rolesetVisible = false
-            } else {
-              _this.$message({
-                type: 'warning',
-                message: res.data.message
-              })
-            }
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-      },
-      handlecheckedrolechange() {
-        let checkedCount = this.selectedrole.length
-        this.roleCheckAll = checkedCount === this.rolelist.length
-        this.isrolecheckall = checkedCount > 0 && checkedCount < this.rolelist.length
-      },
-      handleCheckAllChange(val) {
-        this.selectedrole = val ? this.rolelistcheckall : []
-        this.isrolecheckall = false
-      },
-      roleisexist(val) {
-        for (let i = 0; i < this.rolelist.length; i++) {
-          if (this.rolelist[i].Id === val) {
-            return true
-          }
-        }
-        return false
-      },
-      // loadequipsall() {
-      //   // toggle loading
-      //   let _this = this
-      //   // request
-      //   this.$axios.get('equipment/alllist', null)
-      //     .then(res => {
-      //       // response
-      //       _this.equipalllist = res.data.items
-      //       _this.equipdeviceslist = res.data.items
-      //     })
-      //     .catch(err => {
-      //       // handle error
-      //       console.error(err)
-      //       this.loading = false
-      //     })
-      // },
-      seachdata() {
-        this.list = []
-        this.currentPage = 1
-        this.initData()
-      },
-      searchCommand(command) {
-        if (command == 'clear') {
-          this.clearSearch()
-        }
-      },
-      handleSizeChange(value) {
-        this.list = []
-        this.size = value
-        this.currentPage = 1
-        this.initData()
-      },
-      handleCurrentChange(value) {
-        this.currentPage = value
-        this.list = []
-        this.initData()
-      },
-      jstimehandle(val) {
-        val = val.replace('T', ' ')
-        return val.substring(0, 19)
-      },
-      opendatadialog(item, v, index) {
-        let _this = this
-        this.operatingitem = item
-        this.datadialogVisible = true
-        this.clearuserForm()
-        if (item === 1) {
-          this.dialogtitle = '新增用户'
-          this.disabledserial = false
-        } else if (item === 2) {
-          this.$axios.get('organizes/parentlist/' + v.Departmentid, {})
-            .then(res => {
-              if (res.data.code === 0) {
-                _this.dialogtitle = `编辑用户信息(${v.Realname})`
-                _this.disabledserial = true
-                _this.userform.username = v.Username
-                _this.userform.realname = v.Realname + ''
-                _this.userform.telephone = v.Telephone
-                _this.userform.mobile = v.Mobile
-                _this.userform.description = v.Description
-                _this.userform.role = v.Roleid + ''
-                _this.userform.id = v.Id
-                // 选中状态
-                _this.selectedorg = []
-                let pidarr = res.data.message.split(',')
-                for (var i = pidarr.length - 1; i >= 0; i--) {
-                  if (pidarr[i] !== '0') {
-                    _this.selectedorg.push(parseInt(pidarr[i]))
-                  }
-                }
-              } else {
-                _this.$message({
-                  type: 'warning',
-                  message: '出现错误!'
-                })
-                this.datadialogVisible = false
-              }
-            })
-            .catch(err => {
-              // handle error
-              console.error(err)
-            })
-        }
-      },
-      savedata(formName) {
-        let _this = this
-        if (this.selectedorg.length === 0) {
-          _this.$message({
-            type: 'warning',
-            message: '请选择所属组织!'
-          })
-          return
-        }
-        this.$refs[formName].validate((valid) => {
-          if (valid) {
-            this.userform.departmentid = this.selectedorg[this.selectedorg.length - 1] + ''
-            let companyId = this.selectedorg.join(',')
-            let idx = companyId.lastIndexOf(',')
-            let companyIds = '0'
-            if (idx > 0) {
-              companyIds = companyId.substring(0, idx)
-            }
-            this.userform.superior = companyIds
-            console.log(this.userform)
-            if (_this.operatingitem === 1) {
-              _this.$axios.post('users', _this.userform)
-                .then(res => {
-                  // response
-                  if (res.data.code === 0) {
-                    _this.$message({
-                      type: 'success',
-                      message: res.data.message
-                    })
-                    this.list = []
-                    _this.datadialogVisible = false
-                    this.initData()
-                  } else {
-                    _this.$message({
-                      type: 'warning',
-                      message: res.data.message
-                    })
-                  }
-                })
-                .catch(err => {
-                  // handle error
-                  console.error(err)
-                })
-            } else if (_this.operatingitem === 2) {
-              _this.$axios.put('users/' + _this.userform.id, _this.userform)
-                .then(res => {
-                  // response
-                  if (res.data.code === 0) {
-                    _this.$message({
-                      type: 'success',
-                      message: res.data.message
-                    })
-                    this.list = []
-                    _this.datadialogVisible = false
-                    // 更新界面
-                    this.initData()
-                  } else {
-                    _this.$message({
-                      type: 'warning',
-                      message: res.data.message
-                    })
-                  }
-                })
-                .catch(() => {})
-            }
-          } else {
-            return false
-          }
-        })
-      },
-      deletedata(val) {
-        let _this = this
-        _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          _this.$axios.delete('users/' + val.Id, null)
-            .then(res => {
-              // response
-              if (res.data.code === 0) {
-                _this.$message({
-                  type: 'success',
-                  message: res.data.message
-                })
-                this.list = []
-                // 更新界面
-                this.initData()
-              } else {
-                _this.$message({
-                  type: 'warning',
-                  message: res.data.message
-                })
-              }
-            })
-            .catch(() => {})
-        }).catch(() => {})
-      },
-      resetForm(formName) {
-        // this.$refs[formName].resetFields()
-      },
-      clearuserForm() {
-        this.userform = {
-          username: '',
-          realname: '',
-          telephone: '',
-          mobile: '',
-          description: ''
-        }
-      },
-      permission(v) {
-        let _this = this
-        _this.ischeckbj = true // 过滤字段勾选时触发的选中事件
-        this.userpermissdevicesselects = []
-        this.permissiondialogtitle = `用户权限设置(${v.Realname})`
-        this.permissiondatadialogVisible = true
-        this.userform.id = v.Id
-        this.$axios.get('users/permission/' + v.Id, null)
-          .then(res => {
-            // response
-            res.data.forEach((item, k) => {
-              this.userpermissdevicesselects.push(item)
-            })
-            _this.getorgbyeid(res.data + '')
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-      },
-      getorgbyeid(v) {
-        let _this = this
-        this.$axios.put('equipment/getorgidsbyeqids', {
-            EquipmentIds: v
-          })
-          .then(res => {
-            // response
-            setTimeout(function () {
-              setTimeout(function () {
-                _this.ischeckbj = false
-              }, 300)
-              // 清空树选择框
-              _this.$refs.userpermisstree.setCheckedKeys(res.data)
-            }, 100)
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-      },
-      savepermission() {
-        let _this = this
-        _this.$axios.put('users/permission/' + this.userform.id, {
-            channelids: this.userpermissdevicesselects + ''
-          })
-          .then(res => {
-            // response
-            if (res.data.code === 0) {
-              _this.$message({
-                type: 'success',
-                message: res.data.message
-              })
-              _this.permissiondatadialogVisible = false
+              this.addshow = false
             } else {
-              _this.$message({
+              this.$message({
                 type: 'warning',
                 message: res.data.message
               })
             }
           })
-          .catch(() => {})
       },
-      resetpwd(val) {
-        let _this = this
-        _this.$confirm(`此操作将重置用户(${val.Realname})的密码为123456, 是否继续?`, '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          _this.$axios.put('users/resetpwd/' + val.Id, null)
-            .then(res => {
-              // response
-              if (res.data.code === 0) {
-                _this.$message({
-                  type: 'success',
-                  message: res.data.message
-                })
-              } else {
-                _this.$message({
-                  type: 'warning',
-                  message: res.data.message
-                })
-              }
-            })
-            .catch(() => {})
-        }).catch(() => {})
+      edit (val) {
+        this.addshow = true
+        this.entityForm = val
       },
-      // 选择组织树时触发
-      userpermissorgcheckedchange(data, checked, indeterminate) {
+      initData () {
         let _this = this
-        if (!_this.ischeckbj) {
-          if (!_this.isfristchecked) {
-            _this.isfristchecked = true
-            setTimeout(function () {
-              _this.isfristchecked = false
-              _this.checkorgusermanage()
-            }, 100)
-          }
-        }
-      },
-      checkorgusermanage() {
-        let orgids = []
-        let selectnodes = this.$refs.userpermisstree.getCheckedNodes()
-        selectnodes.forEach(row => {
-          orgids.push(row.id)
-        })
         const params = {
-          orgids: orgids
-        }
-        let _this = this
-        this.$axios.get('equipment/getidsbyoid', {
-            params
-          })
-          .then(res => {
-            // response
-            _this.userpermissdevicesselects = []
-            if (res.data) {
-              _this.equipdeviceslist = res.data
-              res.data.forEach(row => {
-                _this.userpermissdevicesselects.push(row.Id)
-              })
-            } else {
-              _this.equipdeviceslist = _this.equipalllist
-            }
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-            this.loading = false
-          })
-      },
-      getorgtreelist() {
-        let _this = this
-        // request
-        let params = {
-          IsInnerOrganize: 1
+          _currentPage: this.currentPage,
+          _size: this.size
         }
-        _this.$axios.get('organizes/list', {
-            params
-          })
+        Object.assign(params, this.searchForm)
+        this.$axios.get('cost/list', {
+          params
+        })
           .then(res => {
-            _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
+            _this.list = res.data.items
+            _this.currentItemCount = res.data.currentItemCount
           })
           .catch(err => {
-            // handle error
             console.error(err)
           })
-      },
-      clearSearch() {
-        this.searchForm.keyword = ''
-        this.searchForm.UserName = ''
-        this.list = []
-        this.initData()
       }
     }
   }
-
 </script>
 
 <style lang="scss">