2
3
lining 6 жил өмнө
parent
commit
f868a5ef63

+ 22 - 0
src/dashoo.cn/backend/api/business/oilclassorgsetting/oilclassorgsetting.go

@@ -0,0 +1,22 @@
+package oilclassorgsetting
+
+import (
+	"time"
+)
+
+type OilClassOrgSetting struct {
+	Id             int       `xorm:"not null pk autoincr INT(10)"`
+	ClassId        int       `xorm:"not null default 0 comment('分类编码ID') INT(11)"`
+	OrganizeId     int       `xorm:"not null default 0 comment('单位ID') INT(10)"`
+	OrganizeName   string    `xorm:"comment('单位名称') VARCHAR(100)"`
+	AuditStepCode  string    `xorm:"not null default '0' comment('审批步骤编码') VARCHAR(20)"`
+	AuditStepName  string    `xorm:"comment('审批步骤名称') VARCHAR(50)"`
+	Remark         string    `xorm:"comment('备注') VARCHAR(500)"`
+	IsDelete       int       `xorm:"default 0 comment('删除状态,0正常,1已删除') INT(10)"`
+	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)"`
+	ModifiedBy     string    `xorm:"VARCHAR(50)"`
+}

+ 5 - 0
src/dashoo.cn/backend/api/business/oilsupplier/goodsaptitude/oilgoodsaptitude.go

@@ -89,3 +89,8 @@ type GoodsBusiness struct {
 	Remark            string
 	DeletionStateCode int
 }
+
+type OrganizeSet struct {
+	ClassId        int
+	OrganizeIds    []string
+}

+ 1 - 1
src/dashoo.cn/backend/api/controllers/oilsupplier/basisbuild.go

@@ -295,4 +295,4 @@ func (this *OilBasisBuildController) BasicList() {
 	datainfo.CurrentItemCount = total
 	this.Data["json"] = &datainfo
 	this.ServeJSON()
-}
+}

+ 0 - 1
src/dashoo.cn/backend/api/controllers/oilsupplier/goodsaptitude.go

@@ -2,7 +2,6 @@ package oilsupplier
 
 import (
 	"encoding/json"
-
 	"time"
 
 	"dashoo.cn/backend/api/business/baseUser"

+ 96 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/oilclassorgsetting.go

@@ -0,0 +1,96 @@
+package oilsupplier
+
+import (
+	"dashoo.cn/backend/api/business/oilclassorgsetting"
+	"dashoo.cn/backend/api/business/oilsupplier/goodsaptitude"
+	"dashoo.cn/business2/organize"
+	"dashoo.cn/business2/permission"
+	"dashoo.cn/utils"
+	"strconv"
+	"strings"
+	"time"
+	. "dashoo.cn/backend/api/controllers"
+)
+
+type OilclassorgsettingController struct {
+	BaseController
+}
+
+type OrganizeAjaxModel struct {
+	Organize         []organize.Base_Organizetree
+	SelectedOrganize []int
+}
+
+
+// @Title 添加审批部门
+// @Description 新增
+// @Param 	body body oilclassorgsetting.OilClassOrgSetting
+// @Success	200	{object} controllers.Request
+// @router /addorganize  [post]
+func (this *OilclassorgsettingController) AddOrganize() {
+	var organizes []organize.Base_Organize
+	classid := this.GetString("classId")
+	organizeids := strings.Split(this.GetString("organizeids"), ",")
+	svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
+
+	var err error
+	where := "classId=" + classid
+	svc.DeleteEntityBytbl(OilClassOrgSettingName, where)
+	var model oilclassorgsetting.OilClassOrgSetting
+	if (len(organizeids) > 0) {
+		for i := 0; i < len(organizeids); i++ {
+			where := "Id=" + organizeids[i]
+			svc.GetEntitysByWhere("Base_Organize", where, &organizes)
+		}
+		if (organizes != nil) {
+			for i := 0;i < len(organizes);i++ {
+				var model oilclassorgsetting.OilClassOrgSetting
+				model.ClassId,_ = strconv.Atoi(classid)
+				model.OrganizeId = organizes[i].Id
+				model.OrganizeName = organizes[i].Fullname
+				model.CreateOn = time.Now()
+				model.CreateBy = this.User.Realname
+				model.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
+				_, err = svc.InsertEntityBytbl(OilClassOrgSettingName, &model)
+			}
+		}
+	}
+	var errinfo ErrorDataInfo
+	if err == nil {
+		//新增
+		errinfo.Message = "添加成功!"
+		errinfo.Code = 0
+		errinfo.Item = model.Id
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	} else {
+		errinfo.Message = "添加失败!" + utils.AlertProcess(err.Error())
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	}
+}
+
+// @Title 获得部门
+// @Description 获得部门
+// @Success	200	{object} controllers.Request
+// @router /getdepartment [get]
+func (this *OilclassorgsettingController) DepartmentListGet() {
+	id := this.GetString("id") //roleid
+	svc := permission.GetPermissionService(utils.DBE)
+	currentuser := this.User
+	userid := utils.ToStr(currentuser.Id)
+	organizemodu := svc.GetOrganizeTree(userid)
+
+	var selected []int
+	var list []oilclassorgsetting.OilClassOrgSetting
+	where := "classId=" + id
+	svc.GetEntities(&list, where)
+	for _, item := range list {
+		selected = append(selected, item.OrganizeId)
+	}
+	//organizeselectedmodu := svc.GetOrganizeTreeByRole(id)
+	rest := OrganizeAjaxModel{organizemodu, selected}
+	this.Data["json"] = &rest
+	this.ServeJSON()
+}

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

@@ -310,6 +310,12 @@ func init() {
 				&oilsupplier.AnnualAuditController{},
 			),
 		),
+		//审批部门设置
+		beego.NSNamespace("/oilclassorgsetting",
+			beego.NSInclude(
+				&oilsupplier.OilclassorgsettingController{},
+			),
+		),
 	)
 	beego.AddNamespace(ns)
 }

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

@@ -38,5 +38,11 @@ export default {
       url: '/basisbuild/delete/' + entityId,
       method: 'delete'
     })
+  },
+  addOrganize (classId, organizeids, myAxios) {
+    return myAxios({
+      url: '/oilclassorgsetting/addorganize?classId=' + classId + '&organizeids=' + organizeids,
+      method: 'post'
+    })
   }
 }

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

@@ -37,5 +37,11 @@ export default {
       url: '/goodsaptitude/delete/' + entityId,
       method: 'delete'
     })
+  },
+  addOrganize (classId, organizeids, myAxios) {
+    return myAxios({
+      url: '/oilclassorgsetting/addorganize?classId=' + classId + '&organizeids=' + organizeids,
+      method: 'post'
+    })
   }
 }

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

@@ -37,5 +37,11 @@ export default {
       url: '/technologyservice/delete/' + entityId,
       method: 'delete'
     })
+  },
+  addOrganize (classId, organizeids, myAxios) {
+    return myAxios({
+      url: '/oilclassorgsetting/addorganize?classId=' + classId + '&organizeids=' + organizeids,
+      method: 'post'
+    })
   }
 }

+ 217 - 133
src/dashoo.cn/frontend_web/src/pages/oilsupplier/basisbuild/index.vue

@@ -37,20 +37,28 @@
             <router-link :to="'/oilsupplier/basisbuild/' + scope.row.Id + '/operation'">
               <el-button type="primary" plain title="编辑" size="mini">编辑</el-button>
             </router-link>
-
-            <el-popover placement="top" title="提示">
-              <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" type="primary" plain title="删除" style="margin-left:3px" size="mini">删除</el-button>
-            </el-popover>
+            <el-dropdown @command="MoreCmdClick">
+              <el-button size="mini" type="primary" plain>
+                更多<i class="el-icon-arrow-down el-icon--right"></i>
+              </el-button>
+              <el-dropdown-menu slot="dropdown">
+                <el-dropdown-item :command="GetCommand('Set', scope.row)">审核部门</el-dropdown-item>
+                <el-dropdown-item :command="GetCommand('Delete', scope.row)">删除数据</el-dropdown-item>
+              </el-dropdown-menu>
+            </el-dropdown>
+            <!--<el-popover placement="top" title="提示">-->
+              <!--<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" type="primary" plain title="删除" style="margin-left:3px" size="mini">删除</el-button>-->
+            <!--</el-popover>-->
           </template>
         </el-table-column>
 
@@ -382,14 +390,22 @@
         <el-button size="mini" type="primary" @click="handleSearch">查 询</el-button>
       </span>
     </el-dialog>
+    <el-dialog title="设置审批部门" :visible.sync="deptsetVisible">
+      <el-tree style="border: 0" show-checkbox node-key="id" :data="operationOrganizeData" :props="organizeProps" ref="operationOriganizeTree">
+      </el-tree>
+      <div slot="footer">
+        <el-button @click="deptsetVisible = false">取消</el-button>
+        <el-button type="primary" @click="saveApprovalDept()">确定</el-button>
+      </div>
+    </el-dialog>
 
   </div>
 </template>
 <script>
   import {
     mapGetters
-  } from 'vuex';
-  import api from '@/api/oilsupplier/basisbuild';
+  } from 'vuex'
+  import api from '@/api/oilsupplier/basisbuild'
 
   export default {
     computed: {
@@ -399,23 +415,24 @@
     },
     name: 'oilbasisbuild',
 
-    data() {
+    data () {
       return {
+        deptsetVisible: false,
         dialogVisible: false,
-        //列表数据
+        // 列表数据
         entityList: [],
-        //分页参数
+        // 分页参数
         size: 10,
         currentPage: 1,
         currentItemCount: 0,
-        //列表排序
+        // 列表排序
         Column: {
           Order: '',
           Prop: ''
         },
-        //查询时间
+        // 查询时间
         CreateOn: [new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()],
-        //查询项
+        // 查询项
         searchFormReset: {},
         searchForm: {
           Id: '',
@@ -461,363 +478,425 @@
           F38: '',
           F39: '',
           F40: '',
-          Remark: '',
+          Remark: ''
 
         },
         tableColumns: [
 
           {
-            prop: "Code",
+            prop: 'Code',
             label: '编码',
             width: 100,
             sort: true
           },
 
           {
-            prop: "Name",
+            prop: 'Name',
             label: '名称',
             width: 100,
             sort: true
           },
 
           {
-            prop: "F01",
+            prop: 'F01',
             label: '营业执照',
             width: 180,
             sort: true
           },
 
           {
-            prop: "F02",
+            prop: 'F02',
             label: '组织机构代码证',
             width: 200,
             sort: true
           },
 
           {
-            prop: "F03",
+            prop: 'F03',
             label: '税务登记证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F04 ",
+            prop: 'F04 ',
             label: '银行开户许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F05",
+            prop: 'F05',
             label: '质量管理体系认证证书',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F06",
+            prop: 'F06',
             label: '环境管理体系认证证书',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F07",
+            prop: 'F07',
             label: '职业健康安全管理体系认证证书',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F08",
+            prop: 'F08',
             label: '软件企业认定证书',
             width: 160,
             sort: true
           },
 
           {
-            prop: "F09",
+            prop: 'F09',
             label: '安全生产许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F10",
+            prop: 'F10',
             label: '陆上石油天然气安全生产许可证',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F11",
+            prop: 'F11',
             label: '海洋石油作业安全生产许可证',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F12",
+            prop: 'F12',
             label: '辐射安全许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F13",
+            prop: 'F13',
             label: '石油工程技术服务企业资质证书',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F14",
+            prop: 'F14',
             label: '物业服务企业资质证书',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F15",
+            prop: 'F15',
             label: '工业清洗企业资质证书',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F16",
+            prop: 'F16',
             label: '建设项目环境影响评价资格证书',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F17",
+            prop: 'F17',
             label: '消防设施维护保养资质证书',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F18",
+            prop: 'F18',
             label: '安全评价机构资质证书',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F19",
+            prop: 'F19',
             label: '工程咨询招标代理机构资质证书',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F20",
+            prop: 'F20',
             label: '工程监督资质证书',
             width: 160,
             sort: true
           },
 
           {
-            prop: "F21",
+            prop: 'F21',
             label: '土地开发资格证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F22",
+            prop: 'F22',
             label: '房屋预售资格证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F23",
+            prop: 'F23',
             label: '保安服务许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F24",
+            prop: 'F24',
             label: '道路运输经营许可证',
             width: 180,
             sort: true
           },
 
           {
-            prop: "F25",
+            prop: 'F25',
             label: '机动车维修经营许可证',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F26",
+            prop: 'F26',
             label: '道路危险货物运输许可证',
             width: 200,
             sort: true
           },
 
           {
-            prop: "F27",
+            prop: 'F27',
             label: '特种设备安装改造维修许可证',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F28",
+            prop: 'F28',
             label: '建筑安全许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F29",
+            prop: 'F29',
             label: '防火许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F30",
+            prop: 'F30',
             label: '印刷经营许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F31",
+            prop: 'F31',
             label: '餐饮服务许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F32",
+            prop: 'F32',
             label: '劳务派遣经营许可证',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F33",
+            prop: 'F33',
             label: '人力资源服务许可证',
             width: 180,
             sort: true
           },
 
           {
-            prop: "F34",
+            prop: 'F34',
             label: '国家实验室认可证书',
             width: 180,
             sort: true
           },
 
           {
-            prop: "F35",
+            prop: 'F35',
             label: '海洋石油专业设备检验检测机构证书',
             width: 270,
             sort: true
           },
 
           {
-            prop: "F36",
+            prop: 'F36',
             label: '安全生产检验检测证书',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F37",
+            prop: 'F37',
             label: '液化气钢瓶检验证书',
             width: 180,
             sort: true
           },
 
           {
-            prop: "F38",
+            prop: 'F38',
             label: '国家电网承试承装承修许可证',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F39",
+            prop: 'F39',
             label: '建筑企业资质证书',
             width: 170,
             sort: true
           },
 
           {
-            prop: "F40",
+            prop: 'F40',
             label: '中油集团监造许可',
             width: 170,
             sort: true
           },
           {
-            prop: "Remark",
+            prop: 'Remark',
             label: '备注',
             width: 100,
             sort: true
           },
 
           {
-            prop: "ModifiedOn",
+            prop: 'ModifiedOn',
             label: '添加时间',
             width: 150,
             sort: true
           },
 
           {
-            prop: "Remark",
+            prop: 'Remark',
             label: '备注',
             width: 100,
             sort: true
           },
 
           {
-            prop: "CreateOn",
+            prop: 'CreateOn',
             label: '创建时间',
             width: 100,
             sort: true
-          },
-
-        ]
+          }
+        ],
+        organizeProps: {
+          value: 'id',
+          label: 'name',
+          children: 'children'
+        },
+        operationOrganizeData: []
       }
     },
-    created() {
-      //查询条件初始值备份
-      Object.assign(this.searchFormReset, this.searchForm);
-      //查询列表
-      this.initDatas();
-      //this.getDictOptions()
+    created () {
+      // 查询条件初始值备份
+      Object.assign(this.searchFormReset, this.searchForm)
+      // 查询列表
+      this.initDatas()
+      // this.getDictOptions()
     },
     methods: {
-      initDatas() {
-        //分页及列表条件
+      saveApprovalDept () {
+        let organizeids = []
+        let organize = this.$refs.operationOriganizeTree.getCheckedNodes()
+        organize.forEach(row => {
+          organizeids.push(row.id)
+        })
+        console.log(organizeids, 'organizeids')
+
+        api.addOrganize(this.selecteclassid, organizeids, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+            this.deptsetVisible = false
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+          console.log(res.data)
+        }).catch(err => {
+          console.log(err)
+        })
+      },
+      deptSet (val) {
+        this.deptsetVisible = true
+        this.selecteclassid = val.Id
+        // request
+        this.$axios.get('goodsaptitude/getdepartment?id=' + this.selecteclassid, {})
+          .then(res => {
+            console.log(res.data, '===')
+            // response
+            this.operationOrganizeData = window.toolfun_gettreejson(res.data.Organize, 'id', 'pId', 'id,name,scope')
+            if (!res.data.SelectedOrganize) {
+              res.data.SelectedOrganize = []
+            }
+            this.$refs.operationOriganizeTree.setCheckedKeys(res.data.SelectedOrganize, true)
+          })
+          .catch(err => {
+            console.log(err)
+          })
+      },
+      MoreCmdClick (cmd) {
+        if (cmd.Command === 'Set') {
+          this.deptSet(cmd.row)
+        } else if (cmd.Command === 'Delete') {
+          this.deleteEntity(cmd.row)
+        }
+      },
+      GetCommand (cmdType, row) {
+        let cmd = {}
+        cmd.Command = cmdType
+        cmd.row = row
+        return cmd
+      },
+      initDatas () {
+        // 分页及列表条件
         let params = {
           _currentPage: this.currentPage,
           _size: this.size,
           Order: this.Column.Order,
-          Prop: this.Column.Prop,
+          Prop: this.Column.Prop
         }
         let myCreateOn = []
         // 解析时间
-        if (this.CreateOn.length == 2) {
+        if (this.CreateOn.length === 2) {
           this.CreateOn[1].setHours(23)
           this.CreateOn[1].setMinutes(59)
           this.CreateOn[1].setSeconds(59)
           myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
           myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
         }
-        //查询条件
+        // 查询条件
         Object.assign(params, this.searchForm)
-        //访问接口
+        // 访问接口
         api.getList(myCreateOn.join(','), params, this.$axios).then(res => {
           this.entityList = res.data.items
           this.currentItemCount = res.data.currentItemCount
@@ -826,75 +905,81 @@
         })
       },
 
-      getDictOptions() {
+      getDictOptions () {
         api.getDictList(this.$axios).then(res => {
-          //this.dictOptions.customerList = res.data.items['customerList']
-          //this.dictOptions.projectList = res.data.items['projectList']
+          // this.dictOptions.customerList = res.data.items['customerList']
+          // this.dictOptions.projectList = res.data.items['projectList']
 
         }).catch(err => {
           console.error(err)
         })
       },
 
-      searchCommand(command) {
-        if (command == 'search') {
+      searchCommand (command) {
+        if (command === 'search') {
           this.dialogVisible = true
-        } else if (command == 'clear') {
+        } else if (command === 'clear') {
           this.clearSearch()
         }
       },
-      //列表排序功能
-      orderby(column) {
-        if (column.order == 'ascending') {
+      // 列表排序功能
+      orderby (column) {
+        if (column.order === 'ascending') {
           this.Column.Order = 'asc'
-        } else if (column.order == 'descending') {
+        } else if (column.order === 'descending') {
           this.Column.Order = 'desc'
         }
         this.Column.Prop = column.prop
         this.initDatas()
       },
-      clearSearch() {
-        Object.assign(this.searchForm, this.searchFormReset);
-        //this.searchForm = this.searchFormReset;
+      clearSearch () {
+        Object.assign(this.searchForm, this.searchFormReset)
+        // this.searchForm = this.searchFormReset;
         this.CreateOn = ''
         this.initDatas()
       },
-      handleSearch() {
-        this.currentPage = 1;
-        this.dialogVisible = false;
-        this.initDatas();
+      handleSearch () {
+        this.currentPage = 1
+        this.dialogVisible = false
+        this.initDatas()
       },
-      handleCurrentChange(value) {
+      handleCurrentChange (value) {
         this.currentPage = value
         this.initDatas()
       },
-      handleSizeChange(value) {
+      handleSizeChange (value) {
         this.size = value
         this.currentPage = 1
         this.initDatas()
       },
-      deleteEntity(row) {
-        row.deleteConfirmFlag = false;
-        api.deleteEntity(row.Id, this.$axios).then(res => {
-          if (res.data.code === 0) {
-            this.initDatas();
-            this.$message({
-              type: 'success',
-              message: res.data.message
-            });
-
-          } else {
-            this.$message({
-              type: 'warning',
-              message: res.data.message
-            });
-          }
+      deleteEntity (row) {
+        this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          api.deleteEntity(row.Id, this.$axios).then(res => {
+            if (res.data.code === 0) {
+              this.initDatas()
+              this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+            } else {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          }).catch(err => {
+            console.error(err)
+          })
         }).catch(err => {
           console.error(err)
-        });
+        })
       },
 
-      transferStr(val) {
+      transferStr (val) {
         if (val === '1') {
           return '是'
         }
@@ -905,7 +990,7 @@
         }
       },
 
-      jstimehandle(val) {
+      jstimehandle (val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -918,18 +1003,17 @@
         }
       },
 
-      formatDateTime(date) {
-        var y = date.getFullYear();
-        var m = date.getMonth() + 1;
-        m = m < 10 ? ('0' + m) : m;
-        var d = date.getDate();
-        d = d < 10 ? ('0' + d) : d;
-        var h = date.getHours();
-        var minute = date.getMinutes();
-        minute = minute < 10 ? ('0' + minute) : minute;
-        return y + '-' + m + '-' + d + ' ' + h + ':' + minute;
+      formatDateTime (date) {
+        var y = date.getFullYear()
+        var m = date.getMonth() + 1
+        m = m < 10 ? ('0' + m) : m
+        var d = date.getDate()
+        d = d < 10 ? ('0' + d) : d
+        var h = date.getHours()
+        var minute = date.getMinutes()
+        minute = minute < 10 ? ('0' + minute) : minute
+        return y + '-' + m + '-' + d + ' ' + h + ':' + minute
       }
     }
   }
-
 </script>

+ 231 - 144
src/dashoo.cn/frontend_web/src/pages/oilsupplier/goodsaptitude/index.vue

@@ -37,20 +37,31 @@
             <router-link :to="'/oilsupplier/goodsaptitude/' + scope.row.Id + '/operation'">
               <el-button type="primary" plain title="编辑" size="mini">编辑</el-button>
             </router-link>
-
-            <el-popover placement="top" title="提示">
-              <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" type="primary" plain title="删除" style="margin-left:3px" size="mini">删除</el-button>
-            </el-popover>
+            <el-dropdown @command="MoreCmdClick">
+              <el-button size="mini" type="primary" plain>
+                更多<i class="el-icon-arrow-down el-icon--right"></i>
+              </el-button>
+              <el-dropdown-menu slot="dropdown">
+                <el-dropdown-item :command="GetCommand('Set', scope.row)">审核部门</el-dropdown-item>
+                <el-dropdown-item :command="GetCommand('Delete', scope.row)">删除数据</el-dropdown-item>
+              </el-dropdown-menu>
+            </el-dropdown>
+            <!--<el-button size="small" type="text" style="margin-left:3px" title="审批部门" @click="deptSet(scope.row)">-->
+              <!--<i class="icon icon-users"></i>-->
+            <!--</el-button>-->
+            <!--<el-popover placement="top" title="提示" v-model="scope.row.deleteConfirmFlag">-->
+              <!--<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" type="primary" plain title="删除" style="margin-left:3px" size="mini">删除</el-button>-->
+            <!--</el-popover>-->
           </template>
         </el-table-column>
 
@@ -483,14 +494,19 @@
         <el-button size="mini" type="primary" @click="handleSearch">查 询</el-button>
       </span>
     </el-dialog>
-
+    <el-dialog title="设置审批部门" :visible.sync="deptsetVisible">
+      <el-tree style="border: 0" show-checkbox node-key="id" :data="operationOrganizeData" :props="organizeProps" ref="operationOriganizeTree">
+      </el-tree>
+      <div slot="footer">
+        <el-button @click="deptsetVisible = false">取消</el-button>
+        <el-button type="primary" @click="saveApprovalDept()">确定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 <script>
-  import {
-    mapGetters
-  } from 'vuex';
-  import api from '@/api/oilsupplier/goodsaptitude';
+  import { mapGetters } from 'vuex'
+  import api from '@/api/oilsupplier/goodsaptitude'
 
   export default {
     computed: {
@@ -500,23 +516,24 @@
     },
     name: 'oilgoodsaptitude',
 
-    data() {
+    data () {
       return {
+        deptsetVisible: false,
         dialogVisible: false,
-        //列表数据
+        // 列表数据
         entityList: [],
-        //分页参数
+        // 分页参数
         size: 10,
         currentPage: 1,
         currentItemCount: 0,
-        //列表排序
+        // 列表排序
         Column: {
           Order: '',
           Prop: ''
         },
-        //查询时间
+        // 查询时间
         CreateOn: [new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()],
-        //查询项
+        // 查询项
         searchFormReset: {},
         searchForm: {
           Id: '',
@@ -583,425 +600,475 @@
           CreateBy: '',
           ModifiedOn: '',
           ModifiedUserId: '',
-          ModifiedBy: '',
+          ModifiedBy: ''
 
         },
         tableColumns: [
 
           {
-            prop: "Code",
+            prop: 'Code',
             label: '编码',
             width: 120,
             sort: true
           },
 
           {
-            prop: "Name",
+            prop: 'Name',
             label: '名称',
             width: 150,
             sort: true
           },
 
           {
-            prop: "Code1",
+            prop: 'Code1',
             label: '大类编码',
             width: 120,
             sort: true
           },
           {
-            prop: "Name1",
+            prop: 'Name1',
             label: '大类名称',
             width: 150,
             sort: true
           },
 
           {
-            prop: "Code2",
+            prop: 'Code2',
             label: '中类编码',
             width: 120,
             sort: true
           },
 
           {
-            prop: "Name2",
+            prop: 'Name2',
             label: '中类名称',
             width: 150,
             sort: true
           },
 
           {
-            prop: "Code3",
+            prop: 'Code3',
             label: '小类编码',
             width: 120,
             sort: true
           },
 
           {
-            prop: "Name3",
+            prop: 'Name3',
             label: '小类名称',
             width: 150,
             sort: true
           },
 
           {
-            prop: "Code4",
+            prop: 'Code4',
             label: '品名编码',
             width: 120,
             sort: true
           },
 
           {
-            prop: "Name4",
+            prop: 'Name4',
             label: '品名名称',
             width: 150,
             sort: true
           },
 
           {
-            prop: "GoodsLevel",
+            prop: 'GoodsLevel',
             label: '物资级别',
             width: 100,
             sort: true
           },
 
           {
-            prop: "GoodsDesc",
+            prop: 'GoodsDesc',
             label: '产品说明',
             width: 100,
             sort: true
           },
 
           {
-            prop: "Standard",
+            prop: 'Standard',
             label: '标准备案',
             width: 100,
             sort: true
           },
 
           {
-            prop: "CompanyType",
+            prop: 'CompanyType',
             label: '供应商类型',
             width: 100,
             sort: true
           },
 
           {
-            prop: "F01",
+            prop: 'F01',
             label: '营业执照',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F02",
+            prop: 'F02',
             label: '组织机构代码证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F03",
+            prop: 'F03',
             label: '税务登记证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F04 ",
+            prop: 'F04 ',
             label: '银行开户许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F05",
+            prop: 'F05',
             label: '质量管理体系认证证书',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F06",
+            prop: 'F06',
             label: '环境管理体系认证证书',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F07",
+            prop: 'F07',
             label: '职业健康安全管理体系认证证书',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F08",
+            prop: 'F08',
             label: '软件企业认定证书',
             width: 160,
             sort: true
           },
 
           {
-            prop: "F09",
+            prop: 'F09',
             label: '安全生产许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F10",
+            prop: 'F10',
             label: '陆上石油天然气安全生产许可证',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F11",
+            prop: 'F11',
             label: '海洋石油作业安全生产许可证',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F12",
+            prop: 'F12',
             label: '辐射安全许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F13",
+            prop: 'F13',
             label: '石油工程技术服务企业资质证书',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F14",
+            prop: 'F14',
             label: '物业服务企业资质证书',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F15",
+            prop: 'F15',
             label: '工业清洗企业资质证书',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F16",
+            prop: 'F16',
             label: '建设项目环境影响评价资格证书',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F17",
+            prop: 'F17',
             label: '消防设施维护保养资质证书',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F18",
+            prop: 'F18',
             label: '安全评价机构资质证书',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F19",
+            prop: 'F19',
             label: '工程咨询招标代理机构资质证书',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F20",
+            prop: 'F20',
             label: '工程监督资质证书',
             width: 160,
             sort: true
           },
 
           {
-            prop: "F21",
+            prop: 'F21',
             label: '土地开发资格证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F22",
+            prop: 'F22',
             label: '房屋预售资格证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F23",
+            prop: 'F23',
             label: '保安服务许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F24",
+            prop: 'F24',
             label: '道路运输经营许可证',
             width: 180,
             sort: true
           },
 
           {
-            prop: "F25",
+            prop: 'F25',
             label: '机动车维修经营许可证',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F26",
+            prop: 'F26',
             label: '道路危险货物运输许可证',
             width: 200,
             sort: true
           },
 
           {
-            prop: "F27",
+            prop: 'F27',
             label: '特种设备安装改造维修许可证',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F28",
+            prop: 'F28',
             label: '建筑安全许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F29",
+            prop: 'F29',
             label: '防火许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F30",
+            prop: 'F30',
             label: '印刷经营许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F31",
+            prop: 'F31',
             label: '餐饮服务许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F32",
+            prop: 'F32',
             label: '劳务派遣经营许可证',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F33",
+            prop: 'F33',
             label: '人力资源服务许可证',
             width: 180,
             sort: true
           },
 
           {
-            prop: "F34",
+            prop: 'F34',
             label: '国家实验室认可证书',
             width: 180,
             sort: true
           },
 
           {
-            prop: "F35",
+            prop: 'F35',
             label: '海洋石油专业设备检验检测机构证书',
             width: 270,
             sort: true
           },
 
           {
-            prop: "F36",
+            prop: 'F36',
             label: '安全生产检验检测证书',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F37",
+            prop: 'F37',
             label: '液化气钢瓶检验证书',
             width: 180,
             sort: true
           },
 
           {
-            prop: "F38",
+            prop: 'F38',
             label: '国家电网承试承装承修许可证',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F39",
+            prop: 'F39',
             label: '建筑企业资质证书',
             width: 170,
             sort: true
           },
 
           {
-            prop: "F40",
+            prop: 'F40',
             label: '中油集团监造许可',
             width: 170,
             sort: true
           },
           {
-            prop: "Remark",
+            prop: 'Remark',
             label: '备注',
             width: 100,
             sort: true
-          },
+          }
 
-        ]
+        ],
+        organizeProps: {
+          value: 'id',
+          label: 'name',
+          children: 'children'
+        },
+        operationOrganizeData: []
       }
     },
-    created() {
-      //查询条件初始值备份
-      Object.assign(this.searchFormReset, this.searchForm);
-      //查询列表
-      this.initDatas();
-      //this.getDictOptions()
+    created () {
+      // 查询条件初始值备份
+      Object.assign(this.searchFormReset, this.searchForm)
+      // 查询列表
+      this.initDatas()
+      // this.getDictOptions()
     },
     methods: {
-      initDatas() {
-        //分页及列表条件
+      saveApprovalDept () {
+        let organizeids = []
+        let organize = this.$refs.operationOriganizeTree.getCheckedNodes()
+        organize.forEach(row => {
+          organizeids.push(row.id)
+        })
+        console.log(organizeids, 'organizeids')
+
+        api.addOrganize(this.selecteclassid, organizeids, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+            this.deptsetVisible = false
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+          console.log(res.data)
+        }).catch(err => {
+          console.log(err)
+        })
+      },
+      deptSet (val) {
+        this.deptsetVisible = true
+        this.selecteclassid = val.Id
+        // request
+        this.$axios.get('goodsaptitude/getdepartment?id=' + this.selecteclassid, {})
+          .then(res => {
+            console.log(res.data, '===')
+            // response
+            this.operationOrganizeData = window.toolfun_gettreejson(res.data.Organize, 'id', 'pId', 'id,name,scope')
+            if (!res.data.SelectedOrganize) {
+              res.data.SelectedOrganize = []
+            }
+            this.$refs.operationOriganizeTree.setCheckedKeys(res.data.SelectedOrganize, true)
+          })
+          .catch(err => {
+            console.log(err)
+          })
+      },
+      initDatas () {
+        // 分页及列表条件
         let params = {
           _currentPage: this.currentPage,
           _size: this.size,
           Order: this.Column.Order,
-          Prop: this.Column.Prop,
+          Prop: this.Column.Prop
         }
         let myCreateOn = []
         // 解析时间
-        if (this.CreateOn.length == 2) {
+        if (this.CreateOn.length === 2) {
           this.CreateOn[1].setHours(23)
           this.CreateOn[1].setMinutes(59)
           this.CreateOn[1].setSeconds(59)
           myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
           myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
         }
-        //查询条件
+        // 查询条件
         Object.assign(params, this.searchForm)
-        //访问接口
+        // 访问接口
         api.getList(myCreateOn.join(','), params, this.$axios).then(res => {
           this.entityList = res.data.items
           this.currentItemCount = res.data.currentItemCount
@@ -1010,74 +1077,95 @@
         })
       },
 
-      getDictOptions() {
+      getDictOptions () {
         api.getDictList(this.$axios).then(res => {
-          //this.dictOptions.customerList = res.data.items['customerList']
-          //this.dictOptions.projectList = res.data.items['projectList']
+          // this.dictOptions.customerList = res.data.items['customerList']
+          // this.dictOptions.projectList = res.data.items['projectList']
 
         }).catch(err => {
           console.error(err)
         })
       },
 
-      searchCommand(command) {
-        if (command == 'search') {
+      MoreCmdClick (cmd) {
+        if (cmd.Command === 'Set') {
+          this.deptSet(cmd.row)
+        } else if (cmd.Command === 'Delete') {
+          this.deleteEntity(cmd.row)
+        }
+      },
+      GetCommand (cmdType, row) {
+        let cmd = {}
+        cmd.Command = cmdType
+        cmd.row = row
+        return cmd
+      },
+
+      searchCommand (command) {
+        if (command === 'search') {
           this.dialogVisible = true
-        } else if (command == 'clear') {
+        } else if (command === 'clear') {
           this.clearSearch()
         }
       },
-      //列表排序功能
-      orderby(column) {
-        if (column.order == 'ascending') {
+      // 列表排序功能
+      orderby (column) {
+        if (column.order === 'ascending') {
           this.Column.Order = 'asc'
-        } else if (column.order == 'descending') {
+        } else if (column.order === 'descending') {
           this.Column.Order = 'desc'
         }
         this.Column.Prop = column.prop
         this.initDatas()
       },
-      clearSearch() {
-        Object.assign(this.searchForm, this.searchFormReset);
-        //this.searchForm = this.searchFormReset;
+      clearSearch () {
+        Object.assign(this.searchForm, this.searchFormReset)
+        // this.searchForm = this.searchFormReset;
         this.CreateOn = ''
         this.initDatas()
       },
-      handleSearch() {
-        this.currentPage = 1;
-        this.dialogVisible = false;
-        this.initDatas();
+      handleSearch () {
+        this.currentPage = 1
+        this.dialogVisible = false
+        this.initDatas()
       },
-      handleCurrentChange(value) {
+      handleCurrentChange (value) {
         this.currentPage = value
         this.initDatas()
       },
-      handleSizeChange(value) {
+      handleSizeChange (value) {
         this.size = value
         this.currentPage = 1
         this.initDatas()
       },
-      deleteEntity(row) {
-        row.deleteConfirmFlag = false;
-        api.deleteEntity(row.Id, this.$axios).then(res => {
-          if (res.data.code === 0) {
-            this.initDatas();
-            this.$message({
-              type: 'success',
-              message: res.data.message
-            });
-
-          } else {
-            this.$message({
-              type: 'warning',
-              message: res.data.message
-            });
-          }
+      deleteEntity (row) {
+        // row.deleteConfirmFlag = false
+        this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          api.deleteEntity(row.Id, this.$axios).then(res => {
+            if (res.data.code === 0) {
+              this.initDatas()
+              this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+            } else {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          }).catch(err => {
+            console.error(err)
+          })
         }).catch(err => {
           console.error(err)
-        });
+        })
       },
-      
+
       transferStr (val) {
         if (val === '1') {
           return '是'
@@ -1088,7 +1176,7 @@
         }
       },
 
-      jstimehandle(val) {
+      jstimehandle (val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -1101,18 +1189,17 @@
         }
       },
 
-      formatDateTime(date) {
-        var y = date.getFullYear();
-        var m = date.getMonth() + 1;
-        m = m < 10 ? ('0' + m) : m;
-        var d = date.getDate();
-        d = d < 10 ? ('0' + d) : d;
-        var h = date.getHours();
-        var minute = date.getMinutes();
-        minute = minute < 10 ? ('0' + minute) : minute;
-        return y + '-' + m + '-' + d + ' ' + h + ':' + minute;
+      formatDateTime (date) {
+        var y = date.getFullYear()
+        var m = date.getMonth() + 1
+        m = m < 10 ? ('0' + m) : m
+        var d = date.getDate()
+        d = d < 10 ? ('0' + d) : d
+        var h = date.getHours()
+        var minute = date.getMinutes()
+        minute = minute < 10 ? ('0' + minute) : minute
+        return y + '-' + m + '-' + d + ' ' + h + ':' + minute
       }
     }
   }
-
 </script>

+ 226 - 142
src/dashoo.cn/frontend_web/src/pages/oilsupplier/technologyservice/index.vue

@@ -37,20 +37,28 @@
             <router-link :to="'/oilsupplier/technologyservice/' + scope.row.Id + '/operation'">
               <el-button type="primary" plain title="编辑" size="mini">编辑</el-button>
             </router-link>
-
-            <el-popover placement="top" title="提示">
-              <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" type="primary" plain title="删除" style="margin-left:3px" size="mini">删除</el-button>
-            </el-popover>
+            <el-dropdown @command="MoreCmdClick">
+              <el-button size="mini" type="primary" plain>
+                更多<i class="el-icon-arrow-down el-icon--right"></i>
+              </el-button>
+              <el-dropdown-menu slot="dropdown">
+                <el-dropdown-item :command="GetCommand('Set', scope.row)">审核部门</el-dropdown-item>
+                <el-dropdown-item :command="GetCommand('Delete', scope.row)">删除数据</el-dropdown-item>
+              </el-dropdown-menu>
+            </el-dropdown>
+            <!--<el-popover placement="top" title="提示">-->
+              <!--<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" type="primary" plain title="删除" style="margin-left:3px" size="mini">删除</el-button>-->
+            <!--</el-popover>-->
           </template>
         </el-table-column>
 
@@ -162,12 +170,20 @@
         <el-button size="mini" type="primary" @click="handleSearch">查 询</el-button>
       </span>
     </el-dialog>
+    <el-dialog title="设置审批部门" :visible.sync="deptsetVisible">
+      <el-tree style="border: 0" show-checkbox node-key="id" :data="operationOrganizeData" :props="organizeProps" ref="operationOriganizeTree">
+      </el-tree>
+      <div slot="footer">
+        <el-button @click="deptsetVisible = false">取消</el-button>
+        <el-button type="primary" @click="saveApprovalDept()">确定</el-button>
+      </div>
+    </el-dialog>
 
   </div>
 </template>
 <script>
-  import { mapGetters } from 'vuex';
-  import api from '@/api/oilsupplier/technologyservice';
+  import { mapGetters } from 'vuex'
+  import api from '@/api/oilsupplier/technologyservice'
 
   export default {
     computed: {
@@ -177,23 +193,24 @@
     },
     name: 'oiltechnologyservice',
 
-    data() {
+    data () {
       return {
+        deptsetVisible: false,
         dialogVisible: false,
-        //列表数据
+        // 列表数据
         entityList: [],
-        //分页参数
+        // 分页参数
         size: 10,
         currentPage: 1,
         currentItemCount: 0,
-        //列表排序
+        // 列表排序
         Column: {
           Order: '',
           Prop: ''
         },
-        //查询时间
+        // 查询时间
         CreateOn: [new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()],
-        //查询项
+        // 查询项
         searchFormReset: {},
         searchForm: {
           Code: '',
@@ -211,7 +228,7 @@
           F01: '',
           F02: '',
           F03: '',
-          F04 : '',
+          F04: '',
           F05: '',
           F06: '',
           F07: '',
@@ -253,413 +270,475 @@
         },
         tableColumns: [
           {
-            prop: "Code",
+            prop: 'Code',
             label: '编码',
             width: 120,
             sort: true
           },
 
           {
-            prop: "Name",
+            prop: 'Name',
             label: '名称',
             width: 150,
             sort: true
           },
 
           {
-            prop: "Code1",
+            prop: 'Code1',
             label: '一级编码',
             width: 120,
             sort: true
           },
 
           {
-            prop: "Name1",
+            prop: 'Name1',
             label: '一级名称',
             width: 150,
             sort: true
           },
 
           {
-            prop: "Code2",
+            prop: 'Code2',
             label: '二级编码',
             width: 120,
             sort: true
           },
 
           {
-            prop: "Name2",
+            prop: 'Name2',
             label: '二级名称',
             width: 150,
             sort: true
           },
 
           {
-            prop: "Code3",
+            prop: 'Code3',
             label: '三级编码',
             width: 120,
             sort: true
           },
 
           {
-            prop: "Name3",
+            prop: 'Name3',
             label: '三级名称',
             width: 150,
             sort: true
           },
 
           {
-            prop: "Code4",
+            prop: 'Code4',
             label: '四级编码',
             width: 120,
             sort: true
           },
 
           {
-            prop: "Name4",
+            prop: 'Name4',
             label: '四级名称',
             width: 150,
             sort: true
           },
 
-          /*{
+          /* {
             prop: "OrgId",
             label: '部门ID',
             width: 120,
             sort: true
-          },*/
+          }, */
 
           {
-            prop: "OrgName",
+            prop: 'OrgName',
             label: '部门名称',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F01",
+            prop: 'F01',
             label: '营业执照',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F02",
+            prop: 'F02',
             label: '组织机构代码证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F03",
+            prop: 'F03',
             label: '税务登记证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F04 ",
+            prop: 'F04 ',
             label: '银行开户许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F05",
+            prop: 'F05',
             label: '质量管理体系认证证书',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F06",
+            prop: 'F06',
             label: '环境管理体系认证证书',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F07",
+            prop: 'F07',
             label: '职业健康安全管理体系认证证书',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F08",
+            prop: 'F08',
             label: '软件企业认定证书',
             width: 160,
             sort: true
           },
 
           {
-            prop: "F09",
+            prop: 'F09',
             label: '安全生产许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F10",
+            prop: 'F10',
             label: '陆上石油天然气安全生产许可证',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F11",
+            prop: 'F11',
             label: '海洋石油作业安全生产许可证',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F12",
+            prop: 'F12',
             label: '辐射安全许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F13",
+            prop: 'F13',
             label: '石油工程技术服务企业资质证书',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F14",
+            prop: 'F14',
             label: '物业服务企业资质证书',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F15",
+            prop: 'F15',
             label: '工业清洗企业资质证书',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F16",
+            prop: 'F16',
             label: '建设项目环境影响评价资格证书',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F17",
+            prop: 'F17',
             label: '消防设施维护保养资质证书',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F18",
+            prop: 'F18',
             label: '安全评价机构资质证书',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F19",
+            prop: 'F19',
             label: '工程咨询招标代理机构资质证书',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F20",
+            prop: 'F20',
             label: '工程监督资质证书',
             width: 160,
             sort: true
           },
 
           {
-            prop: "F21",
+            prop: 'F21',
             label: '土地开发资格证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F22",
+            prop: 'F22',
             label: '房屋预售资格证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F23",
+            prop: 'F23',
             label: '保安服务许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F24",
+            prop: 'F24',
             label: '道路运输经营许可证',
             width: 180,
             sort: true
           },
 
           {
-            prop: "F25",
+            prop: 'F25',
             label: '机动车维修经营许可证',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F26",
+            prop: 'F26',
             label: '道路危险货物运输许可证',
             width: 200,
             sort: true
           },
 
           {
-            prop: "F27",
+            prop: 'F27',
             label: '特种设备安装改造维修许可证',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F28",
+            prop: 'F28',
             label: '建筑安全许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F29",
+            prop: 'F29',
             label: '防火许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F30",
+            prop: 'F30',
             label: '印刷经营许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F31",
+            prop: 'F31',
             label: '餐饮服务许可证',
             width: 150,
             sort: true
           },
 
           {
-            prop: "F32",
+            prop: 'F32',
             label: '劳务派遣经营许可证',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F33",
+            prop: 'F33',
             label: '人力资源服务许可证',
             width: 180,
             sort: true
           },
 
           {
-            prop: "F34",
+            prop: 'F34',
             label: '国家实验室认可证书',
             width: 180,
             sort: true
           },
 
           {
-            prop: "F35",
+            prop: 'F35',
             label: '海洋石油专业设备检验检测机构证书',
             width: 270,
             sort: true
           },
 
           {
-            prop: "F36",
+            prop: 'F36',
             label: '安全生产检验检测证书',
             width: 190,
             sort: true
           },
 
           {
-            prop: "F37",
+            prop: 'F37',
             label: '液化气钢瓶检验证书',
             width: 180,
             sort: true
           },
 
           {
-            prop: "F38",
+            prop: 'F38',
             label: '国家电网承试承装承修许可证',
             width: 250,
             sort: true
           },
 
           {
-            prop: "F39",
+            prop: 'F39',
             label: '建筑企业资质证书',
             width: 170,
             sort: true
           },
 
           {
-            prop: "F40",
+            prop: 'F40',
             label: '中油集团监造许可',
             width: 170,
             sort: true
           },
           {
-            prop: "Remark",
+            prop: 'Remark',
             label: '备注',
             width: 100,
             sort: true
           },
 
           {
-            prop: "ModifiedOn",
+            prop: 'ModifiedOn',
             label: '添加时间',
             width: 150,
             sort: true
-          },
-
-        ]
+          }
+        ],
+        organizeProps: {
+          value: 'id',
+          label: 'name',
+          children: 'children'
+        },
+        operationOrganizeData: []
       }
     },
-    created() {
-      //查询条件初始值备份
-      Object.assign(this.searchFormReset, this.searchForm);
-      //查询列表
-      this.initDatas();
-      //this.getDictOptions()
+    created () {
+      // 查询条件初始值备份
+      Object.assign(this.searchFormReset, this.searchForm)
+      // 查询列表
+      this.initDatas()
+      // this.getDictOptions()
     },
     methods: {
-      initDatas() {
-        //分页及列表条件
+      saveApprovalDept () {
+        let organizeids = []
+        let organize = this.$refs.operationOriganizeTree.getCheckedNodes()
+        organize.forEach(row => {
+          organizeids.push(row.id)
+        })
+        console.log(organizeids, 'organizeids')
+
+        api.addOrganize(this.selecteclassid, organizeids, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+            this.deptsetVisible = false
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+          console.log(res.data)
+        }).catch(err => {
+          console.log(err)
+        })
+      },
+      deptSet (val) {
+        this.deptsetVisible = true
+        this.selecteclassid = val.Id
+        // request
+        this.$axios.get('goodsaptitude/getdepartment?id=' + this.selecteclassid, {})
+          .then(res => {
+            console.log(res.data, '===')
+            // response
+            this.operationOrganizeData = window.toolfun_gettreejson(res.data.Organize, 'id', 'pId', 'id,name,scope')
+            if (!res.data.SelectedOrganize) {
+              res.data.SelectedOrganize = []
+            }
+            this.$refs.operationOriganizeTree.setCheckedKeys(res.data.SelectedOrganize, true)
+          })
+          .catch(err => {
+            console.log(err)
+          })
+      },
+      MoreCmdClick (cmd) {
+        if (cmd.Command === 'Set') {
+          this.deptSet(cmd.row)
+        } else if (cmd.Command === 'Delete') {
+          this.deleteEntity(cmd.row)
+        }
+      },
+      GetCommand (cmdType, row) {
+        let cmd = {}
+        cmd.Command = cmdType
+        cmd.row = row
+        return cmd
+      },
+      initDatas () {
+        // 分页及列表条件
         let params = {
           _currentPage: this.currentPage,
           _size: this.size,
           Order: this.Column.Order,
-          Prop: this.Column.Prop,
+          Prop: this.Column.Prop
         }
-        let myCreateOn = []
+        // let myCreateOn = []
         // 解析时间
-        /*if (this.CreateOn.length == 2) {
+        /* if (this.CreateOn.length == 2) {
           this.CreateOn[1].setHours(23)
           this.CreateOn[1].setMinutes(59)
           this.CreateOn[1].setSeconds(59)
           myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
           myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
-        }*/
-        //查询条件
+        } */
+        // 查询条件
         Object.assign(params, this.searchForm)
-        //访问接口
+        // 访问接口
         api.getList('', params, this.$axios).then(res => {
           this.entityList = res.data.items
           this.currentItemCount = res.data.currentItemCount
@@ -670,70 +749,76 @@
 
       getDictOptions () {
         api.getDictList(this.$axios).then(res => {
-          //this.dictOptions.customerList = res.data.items['customerList']
-          //this.dictOptions.projectList = res.data.items['projectList']
+          // this.dictOptions.customerList = res.data.items['customerList']
+          // this.dictOptions.projectList = res.data.items['projectList']
 
         }).catch(err => {
           console.error(err)
         })
       },
 
-      searchCommand(command) {
-        if (command == 'search') {
+      searchCommand (command) {
+        if (command === 'search') {
           this.dialogVisible = true
-        } else if (command == 'clear') {
+        } else if (command === 'clear') {
           this.clearSearch()
         }
       },
-      //列表排序功能
-      orderby(column) {
-        if (column.order == 'ascending') {
+      // 列表排序功能
+      orderby (column) {
+        if (column.order === 'ascending') {
           this.Column.Order = 'asc'
-        } else if (column.order == 'descending') {
+        } else if (column.order === 'descending') {
           this.Column.Order = 'desc'
         }
         this.Column.Prop = column.prop
         this.initDatas()
       },
-      clearSearch() {
-        Object.assign(this.searchForm, this.searchFormReset);
-        //this.searchForm = this.searchFormReset;
+      clearSearch () {
+        Object.assign(this.searchForm, this.searchFormReset)
+        // this.searchForm = this.searchFormReset;
         this.CreateOn = ''
         this.initDatas()
       },
-      handleSearch() {
-        this.currentPage = 1;
-        this.dialogVisible = false;
-        this.initDatas();
+      handleSearch () {
+        this.currentPage = 1
+        this.dialogVisible = false
+        this.initDatas()
       },
-      handleCurrentChange(value) {
+      handleCurrentChange (value) {
         this.currentPage = value
         this.initDatas()
       },
-      handleSizeChange(value) {
+      handleSizeChange (value) {
         this.size = value
         this.currentPage = 1
         this.initDatas()
       },
-      deleteEntity(row) {
-        row.deleteConfirmFlag = false;
-        api.deleteEntity(row.Id, this.$axios).then(res => {
-          if (res.data.code === 0) {
-            this.initDatas();
-            this.$message({
-              type: 'success',
-              message: res.data.message
-            });
-
-          } else {
-            this.$message({
-              type: 'warning',
-              message: res.data.message
-            });
-          }
+      deleteEntity (row) {
+        this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          api.deleteEntity(row.Id, this.$axios).then(res => {
+            if (res.data.code === 0) {
+              this.initDatas()
+              this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+            } else {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          }).catch(err => {
+            console.error(err)
+          })
         }).catch(err => {
           console.error(err)
-        });
+        })
       },
       transferStr (val) {
         if (val === '1') {
@@ -745,7 +830,7 @@
         }
       },
 
-      jstimehandle(val) {
+      jstimehandle (val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -758,18 +843,17 @@
         }
       },
 
-      formatDateTime(date) {
-        var y = date.getFullYear();
-        var m = date.getMonth() + 1;
-        m = m < 10 ? ('0' + m) : m;
-        var d = date.getDate();
-        d = d < 10 ? ('0' + d) : d;
-        var h = date.getHours();
-        var minute = date.getMinutes();
-        minute = minute < 10 ? ('0' + minute) : minute;
-        return y + '-' + m + '-' + d + ' ' + h + ':' + minute;
+      formatDateTime (date) {
+        var y = date.getFullYear()
+        var m = date.getMonth() + 1
+        m = m < 10 ? ('0' + m) : m
+        var d = date.getDate()
+        d = d < 10 ? ('0' + d) : d
+        var h = date.getHours()
+        var minute = date.getMinutes()
+        minute = minute < 10 ? ('0' + minute) : minute
+        return y + '-' + m + '-' + d + ' ' + h + ':' + minute
       }
     }
   }
-
 </script>