Browse Source

任务看板10.7

caojunjie 1 year ago
parent
commit
4016229b7f

+ 14 - 5
src/api/TaskKanban/task.js

@@ -1,5 +1,6 @@
 import request from '@/router/axios';
 
+// 列表
 export const getList = (current, size, params) => {
   return request({
     url: '/api/blade-mocha-item/task/list',
@@ -11,6 +12,14 @@ export const getList = (current, size, params) => {
     }
   })
 }
+// 统计数据
+export const taskCompletion = (data) => {
+  return request({
+    url: '/api/blade-mocha-item/task/completion',
+    method: 'get',
+    params: data
+  })
+}
 
 export const getDetail = (id) => {
   return request({
@@ -21,7 +30,7 @@ export const getDetail = (id) => {
     }
   })
 }
-
+// 删除
 export const remove = (ids) => {
   return request({
     url: '/api/blade-mocha-item/task/remove',
@@ -31,18 +40,18 @@ export const remove = (ids) => {
     }
   })
 }
-
+// 添加接口
 export const add = (row) => {
   return request({
-    url: '/api/blade-mocha-item/task/submit',
+    url: '/api/blade-mocha-item/task/save',
     method: 'post',
     data: row
   })
 }
-
+// 修改
 export const update = (row) => {
   return request({
-    url: '/api/blade-mocha-item/task/submit',
+    url: '/api/blade-mocha-item/task/update',
     method: 'post',
     data: row
   })

+ 8 - 0
src/enums/column-name.js

@@ -1272,6 +1272,14 @@ const columnName = [{
   {
     code: 286,
     name: '轮胎商城-统计分析-利润总账(月)'
+  },
+  {
+    code: 287,
+    name: '货运代理-基础资料-国家'
+  },
+  {
+    code: 288,
+    name: '任务看板'
   }
 ]
 export const getColumnName = (key) => {

+ 523 - 135
src/views/TaskKanban/index.vue

@@ -5,6 +5,8 @@
                :data="data"
                :page.sync="page"
                :permission="permissionList"
+               id="out-table"
+               :header-cell-class-name="headerClassName"
                :before-open="beforeOpen"
                v-model="form"
                ref="crud"
@@ -13,29 +15,123 @@
                @row-del="rowDel"
                @search-change="searchChange"
                @search-reset="searchReset"
-               @selection-change="selectionChange"
                @current-change="currentChange"
                @size-change="sizeChange"
                @refresh-change="refreshChange"
+               @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 288)"
+               @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 288)"
                @on-load="onLoad">
-      <template slot="menuLeft">
-        <el-button type="danger"
-                   size="small"
-                   icon="el-icon-delete"
-                   plain
-                   v-if="permission.task_delete"
-                   @click="handleDelete">删 除
-        </el-button>
-      </template>
+        <template slot-scope="scope" slot="tsInfo">
+            <span style="color: #1e9fff" @click="chakanfun(scope.row,scope.index)">{{scope.row.tsInfo}}</span>
+        </template>
+        <template slot-scope="scope" slot="isDateExceeded">
+            <span :style="scope.row.isDateExceeded=='已超时'?'color: #de4a3b':'color: #65da78'">{{scope.row.isDateExceeded}}</span>
+        </template>
+        <template slot-scope="scope" slot="menuLeft">
+            <div style="display: flex;align-items: center;margin-top: 10px">
+                <div class="bottomStatistics" style="background: #ffff00" @click="searchChangefun()">全部({{page.total}})</div>
+                <div class="bottomStatistics" style="background: #f8cbad" @click="searchChangefun({type:1})">待执行({{statistics.waitingQuantity}})</div>
+                <div class="bottomStatistics" style="background: #00b050" @click="searchChangefun({type:2})">执行中({{statistics.carryTheQuantity}})</div>
+                <div class="bottomStatistics" style="background: #ffe699" @click="searchChangefun({type:3})">已提交({{statistics.numberOfCommits}})</div>
+                <div class="bottomStatistics" style="background: #a9d08e" @click="searchChangefun({type:4})">工单关闭({{statistics.theNumberOfClosures}})</div>
+            </div>
+        </template>
+        <template slot-scope="scope" slot="menu">
+            <el-button
+                type="text"
+                icon="el-icon-edit"
+                size="small"
+                v-if="responsibleUserObj.createUser == scope.row.responsibleUserId && scope.row.type == 1"
+                @click.stop="Acceptancefun(scope.row)"
+            >受理
+            </el-button>
+            <el-button
+                type="text"
+                icon="el-icon-edit"
+                size="small"
+                v-if="responsibleUserObj.createUser == scope.row.responsibleUserId && scope.row.type == 2"
+                @click.stop="submitTofun(scope.row)"
+            >提交
+            </el-button>
+            <el-button
+                type="text"
+                icon="el-icon-edit"
+                size="small"
+                v-if="responsibleUserObj.createUser == scope.row.createUser && scope.row.type == 3"
+                @click.stop="determinefun(scope.row)"
+            >确认
+            </el-button>
+            <el-button
+                type="text"
+                icon="el-icon-edit"
+                size="small"
+                v-if="responsibleUserObj.createUser == scope.row.createUser && scope.row.type == 3"
+                @click.stop="returnfun(scope.row)"
+            >退回
+            </el-button>
+            <el-button
+                type="text"
+                icon="el-icon-edit"
+                size="small"
+                v-if="responsibleUserObj.createUser == scope.row.createUser && scope.row.type == 3"
+                @click.stop="evaluatefun(scope.row,scope.index)"
+            >评价
+            </el-button>
+            <el-button
+                :type="scope.type"
+                :size="scope.size"
+                icon="el-icon-delete"
+                :disabled="scope.row.type == 4"
+                @click.stop="editOpen(scope.row, scope.index)">编辑
+            </el-button>
+            <el-button
+                :type="scope.type"
+                :size="scope.size"
+                icon="el-icon-delete"
+                v-if="responsibleUserObj.createUser == scope.row.createUser"
+                :disabled="scope.row.type == 4"
+                @click.stop="rowDel(scope.row, scope.index)">删除
+            </el-button>
+        </template>
     </avue-crud>
+
+      <div>
+          <el-row :gutter="20">
+              <el-col :span="4" v-for="item in taskCompletionData" :key="item.id">
+                  <el-card class="box-card">
+                      <div slot="header" class="clearfix">
+                          <span>{{item.userName}}</span>
+                      </div>
+                      <div class="card-flex">
+                          <div class="card-flexLeft" style="color: #ebc4a5">待执行:</div>
+                          <div class="card-flexRight">{{item.waitingQuantity}}</div>
+                      </div>
+                      <div class="card-flex">
+                          <div class="card-flexLeft" style="color: #52a54a">执行中:</div>
+                          <div class="card-flexRight">{{item.carryTheQuantity}}</div>
+                      </div>
+                      <div class="card-flex">
+                          <div class="card-flexLeft" style="color: #f8e292">已提交:</div>
+                          <div class="card-flexRight">{{item.numberOfCommits}}</div>
+                      </div>
+                      <div class="card-flex">
+                          <div class="card-flexLeft" style="color: #de4a3b">超期:</div>
+                          <div class="card-flexRight">{{item.theNumberOfTimeouts}}</div>
+                      </div>
+                  </el-card>
+              </el-col>
+          </el-row>
+      </div>
   </basic-container>
 </template>
 
 <script>
-  import {getList, getDetail, add, update, remove} from "@/api/TaskKanban/task";
+import {getList, getDetail, add, update, remove, taskCompletion} from "@/api/TaskKanban/task";
   import {mapGetters} from "vuex";
   import {getPostList} from "@/api/system/post";
-  import website from "@/config/website";
+import Da from "element-ui/src/locale/lang/da";
+import {getUserApprovalList} from "@/api/approval/processConfig";
+import {dateFormat} from "@/util/date";
 
   export default {
     data() {
@@ -48,36 +144,65 @@
           currentPage: 1,
           total: 0
         },
-        selectionList: [],
-        option: {
+          option:{},
+        optionBack: {
+            addTitle:'创建任务',
+            editTitle:'编辑任务',
+            viewTitle:'查看任务',
+            addBtnText:'创建任务',
+            // dialogDrag:true,
           height:'auto',
           calcHeight: 30,
           tip: false,
           searchShow: true,
-          searchMenuSpan: 6,
+          searchMenuSpan: 24,
           border: true,
           index: true,
           viewBtn: true,
-          selection: true,
+          selection: false,
           dialogClickModal: false,
           column: [
-            {
-              label: "负责人",
-              prop: "responsibleUserId",
-              search: true,
-              type:'select',
-              dicUrl: "/api/blade-user/userList",
-              props: {
-                 label: "realName",
-                 value: "id"
+              {
+                  label: "需求方",
+                  prop: "createUserName",
+                  display:false,
+              },
+              {
+                  label: "负责人",
+                  prop: "responsibleUserId",
+                  search: true,
+                  type:'select',
+                  dicUrl: "/api/blade-user/userList",
+                  props: {
+                      label: "realName",
+                      value: "id"
+                  },
+                  dicData:[],
+                  rules: [{
+                      required: true,
+                      message: "请选择负责人",
+                      trigger: "blur"
+                  }],
+                  // hide:true,
+              },
+              {
+                  label: "抄送人",
+                  prop: "ccId",
+                  type:'tree',
+                  dicUrl: "/api/blade-user/userList",
+                  multiple: true,
+                  props: {
+                      label: "realName",
+                      value: "id"
+                  },
+                  dicData:[],
+                  rules: [{
+                      required: true,
+                      message: "请选择抄送人",
+                      trigger: "blur"
+                  }]
+                  // hide:true,
               },
-                rules: [{
-                    required: true,
-                    message: "请选择负责人",
-                    trigger: "blur"
-                }]
-              // hide:true,
-            },
             {
               label: "岗位",
               prop: "postId",
@@ -88,6 +213,7 @@
                     label: "postName",
                     value: "id"
                 },
+                width:100,
               rules: [{
                 required: true,
                 message: "请选择岗位",
@@ -107,7 +233,12 @@
             {
               label: "要求完成时间",
               prop: "completionTime",
-                // type:'data',
+              width:160,
+                labelWidth:100,
+              type: "datetime",
+              format: "yyyy-MM-dd hh:mm:ss",
+              valueFormat: "yyyy-MM-dd hh:mm:ss",
+              searchRange: true,
               rules: [{
                 required: true,
                 message: "请输入要求完成时间",
@@ -117,6 +248,14 @@
             {
               label: "是否紧急",
               prop: "isUrgency",
+                type:'select',
+                dicData:[{
+                    label:'否',
+                    value:0
+                },{
+                    label:'是',
+                    value:1
+                }],
               rules: [{
                 required: true,
                 message: "请输入是否紧急",
@@ -126,100 +265,167 @@
             {
               label: "未完成原因",
               prop: "unfinishedCause",
-              rules: [{
-                required: true,
-                message: "请输入未完成原因",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "附件",
-              prop: "accessory",
-              rules: [{
-                required: true,
-                message: "请输入附件",
-                trigger: "blur"
-              }]
+                width:120,
             },
             {
               label: "评价",
               prop: "evaluate",
-              rules: [{
-                required: true,
-                message: "请输入评价",
-                trigger: "blur"
-              }]
+                display:false,
             },
             {
               label: "单据类型",
               prop: "documentType",
-              rules: [{
-                required: true,
-                message: "请输入单据类型",
-                trigger: "blur"
-              }]
+                display:false,
+                hide:true,
+                dicData:[{
+                    label:'任务',
+                    value:1
+                },{
+                    label:'状态',
+                    value:2
+                }],
             },
+              {
+                  label: "状态",
+                  prop: "type",
+                  display:false,
+                  type:'select',
+                  dicData:[{
+                      label:'待执行',
+                      value:1
+                  },{
+                      label:'执行中',
+                      value:2
+                  },{
+                      label:'已提交',
+                      value:3
+                  },{
+                      label:'工单关闭',
+                      value:4
+                  },{
+                      label:'未完成',
+                      value:5
+                  }],
+              },
+              {
+                  label: "是否超时",
+                  prop: "isDateExceeded",
+                  display:false,
+              },
+              {
+                  label: "下发时间",
+                  prop: "createTime",
+                  search: true,
+                  type: "date",
+                  format: "yyyy-MM-dd",
+                  valueFormat: "yyyy-MM-dd",
+                  unlinkPanels: true,
+                  searchRange: true,
+                  display:false,
+                  width: 160,
+              },
+              {
+                  label: "完成时间",
+                  prop: "accomplishTime",
+                  type: "date",
+                  format: "yyyy-MM-dd hh:mm:ss",
+                  valueFormat: "yyyy-MM-dd hh:mm:ss",
+                  unlinkPanels: true,
+                  searchRange: true,
+                  display:false,
+                  width: 160,
+              },
             {
               label: "备注",
               prop: "remarks",
-              rules: [{
-                required: true,
-                message: "请输入备注",
-                trigger: "blur"
-              }]
+              type: 'textarea',
+              span: 24,
+              minRows: 3,
             },
+              {
+                  label: "附件",
+                  hide:true,
+                  prop: "accessory",
+                  type: 'upload',
+                  propsHttp: {
+                      url: 'link',
+                      name: 'name',
+                      res: 'data'
+                  },
+                  listType:'picture-card',
+                  dataType:'string',
+                  // dataType:'object',
+                  // props: {
+                  //     label: 'name',
+                  //     value: 'url'
+                  // },
+                  tip: '只能上传jpg/png文件,且不超过500kb',
+                  action: '/api/blade-resource/oss/endpoint/put-file',
+                  span: 24,
+              },
             {
               label: "参考号",
               prop: "refno",
-              rules: [{
-                required: true,
-                message: "请输入参考号",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "状态",
-              prop: "type",
+                hide:true,
                 display:false,
             },
             {
               label: "创建人",
               prop: "createUser",
-                display:false,
-            },
-            {
-              label: "下发时间",
-              prop: "createTime",
-              search: true,
-              type: "date",
-              format: "yyyy-MM-dd",
-              valueFormat: "yyyy-MM-dd",
-              unlinkPanels: true,
-              searchRange: true,
+                hide:true,
                 display:false,
             },
             {
               label: "修改人",
+                hide:true,
               prop: "updateUser",
                 display:false,
             },
             {
               label: "修改时间",
+                hide:true,
               prop: "updateTime",
+                width: 160,
                 display:false,
             },
             {
-              label: "是否已删除(0 否 1是)",
+              label: "是否已删除",
+                hide:true,
+                // (0 否 1是)
               prop: "isDeleted",
                 display:false,
+                type:'select',
+                dicData:[{
+                    label:'否',
+                    value:0
+                },{
+                    label:'是',
+                    value:1
+                }],
             },
           ]
         },
-        data: []
+        data: [],
+          taskCompletionData:[],
+          // 当前登录人的名称和id
+          responsibleUserObj:[],
+          // 表头筛选
+          statistics:{},
+          // 负责人数据
+          dicDataName:[],
       };
     },
-      created() {
-        // this.getPostListfun(website.tenantId)
+      async created() {
+          this.option = await this.getColumnData(this.getColumnName(288), this.optionBack);
+        // 传租户号查询岗位信息
+        this.getPostListfun(JSON.parse(localStorage.getItem('saber-tenantId')).content)
+
+          // 获取当前登录人的名称和id
+          // console.log(JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name)
+          let role = JSON.parse(localStorage.getItem('saber-userInfo')).content
+          this.responsibleUserObj.createUser = role.user_id
+          this.responsibleUserObj.createUserName = role.real_name
+          this.getUserApprovalListfun()
       },
       computed: {
       ...mapGetters(["permission"]),
@@ -231,24 +437,138 @@
           editBtn: this.vaildData(this.permission.task_edit, false)
         };
       },
-      ids() {
-        let ids = [];
-        this.selectionList.forEach(ele => {
-          ids.push(ele.id);
-        });
-        return ids.join(",");
-      }
     },
     methods: {
+        // 获取负责人数据
+        getUserApprovalListfun(){
+            getUserApprovalList().then(res=>{
+                this.findObject(this.option.column, "responsibleUserId").dicData = res.data.data
+                this.findObject(this.option.column, "ccId").dicData = res.data.data
+                this.dicDataName = res.data.data
+            })
+        },
+        // 受理接口
+        Acceptancefun(row) {
+            this.$confirm("确定将选择数据受理?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            })
+                .then(() => {
+                    this.updatefun(row,2)
+                })
+
+        },
+        // 提交
+        submitTofun(row) {
+            this.$confirm("确定将选择数据提交?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            })
+                .then(() => {
+                    this.updatefun(row,3)
+                })
+
+        },
+        // 确认事件
+        determinefun(row){
+            if (!row.evaluate) {
+                this.$message({
+                    type: "success",
+                    message: "请评价后再点工单确认!"
+                });
+                return
+            }
+            this.$confirm("确定将选择数据确认?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            })
+                .then(() => {
+                    this.updatefun({...row,accomplishTime:dateFormat(new Date())},4)
+                })
+        },
+        // 退回事件
+        returnfun(row){
+            this.$confirm("确定将选择数据确认?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            })
+                .then(() => {
+                    this.updatefun(row,2)
+                })
+        },
+        // 评价
+        evaluatefun(row,index){
+            this.findObject(this.option.column, "ccId").disabled = true
+            this.findObject(this.option.column, "responsibleUserId").disabled = true
+            this.findObject(this.option.column, "postId").disabled = true
+            this.findObject(this.option.column, "tsInfo").disabled = true
+            this.findObject(this.option.column, "completionTime").disabled = true
+            this.findObject(this.option.column, "isUrgency").disabled = true
+            this.findObject(this.option.column, "accessory").disabled = true
+
+            this.findObject(this.option.column, "unfinishedCause").disabled = false
+            this.findObject(this.option.column, "evaluate").disabled = false
+            this.findObject(this.option.column, "evaluate").display = true
+            this.$refs.crud.rowEdit(row, index)
+        },
+        // 查看
+        chakanfun(row,index) {
+            this.$refs.crud.rowView(row, index)
+        },
+        // 保存更改状态
+        updatefun(row,type){
+            update({
+                ...row,
+                updateUser:this.responsibleUserObj.createUser,
+                updateUserName:this.responsibleUserObj.createUserName,
+                type:type
+            }).then(() => {
+                this.onLoad(this.page);
+                this.$message({
+                    type: "success",
+                    message: "操作成功!"
+                });
+            }, error => {
+                loading();
+                console.log(error);
+            });
+        },
+        // 更改表格颜色
+        headerClassName(tab){
+            //颜色间隔
+            let back = ""
+            if (tab.columnIndex >= 0 && tab.column.level === 1) {
+                if (tab.columnIndex % 2 === 0) {
+                    back = "back-one"
+                } else if (tab.columnIndex % 2 === 1) {
+                    back = "back-two"
+                }
+            }
+            return back;
+        },
+        // 获取岗位信息
         getPostListfun(tenantId){
             getPostList(tenantId).then(res => {
-                console.log(res,244)
                 const column = this.findObject(this.option.column, "postId");
                 column.dicData = res.data.data;
             });
         },
       rowSave(row, done, loading) {
-        add(row).then(() => {
+            row.ccId = row.ccId.join()
+          this.dicDataName.map(item=>{
+              if (row.responsibleUserId == item.id) {
+                  row.responsibleUserName = item.realName
+              }
+          })
+        add({
+            ...row,
+            type:1,
+            ...this.responsibleUserObj,
+        }).then(() => {
           this.onLoad(this.page);
           this.$message({
             type: "success",
@@ -260,8 +580,13 @@
           window.console.log(error);
         });
       },
+        // 编辑弹窗确认按钮
       rowUpdate(row, index, done, loading) {
-        update(row).then(() => {
+        update({
+            ...row,
+            updateUser:this.responsibleUserObj.createUser,
+            updateUserName:this.responsibleUserObj.createUserName
+        }).then(() => {
           this.onLoad(this.page);
           this.$message({
             type: "success",
@@ -273,6 +598,22 @@
           console.log(error);
         });
       },
+        // 编辑
+        editOpen(row,index){
+            if (this.responsibleUserObj.createUser == row.createUser) {
+
+            }else {
+                this.findObject(this.option.column, "ccId").disabled = true
+                this.findObject(this.option.column, "responsibleUserId").disabled = true
+                this.findObject(this.option.column, "postId").disabled = true
+                this.findObject(this.option.column, "tsInfo").disabled = true
+                this.findObject(this.option.column, "completionTime").disabled = true
+                this.findObject(this.option.column, "isUrgency").disabled = true
+                this.findObject(this.option.column, "accessory").disabled = true
+            }
+            this.$refs.crud.rowEdit(row, index)
+        },
+        // 删除
       rowDel(row) {
         this.$confirm("确定将选择数据删除?", {
           confirmButtonText: "确定",
@@ -280,28 +621,11 @@
           type: "warning"
         })
           .then(() => {
-            return remove(row.id);
-          })
-          .then(() => {
-            this.onLoad(this.page);
-            this.$message({
-              type: "success",
-              message: "操作成功!"
+            return remove({
+                ...row.id,
+                updateUser:this.responsibleUserObj.createUser,
+                updateUserName:this.responsibleUserObj.createUserName
             });
-          });
-      },
-      handleDelete() {
-        if (this.selectionList.length === 0) {
-          this.$message.warning("请选择至少一条数据");
-          return;
-        }
-        this.$confirm("确定将选择数据删除?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        })
-          .then(() => {
-            return remove(this.ids);
           })
           .then(() => {
             this.onLoad(this.page);
@@ -309,9 +633,9 @@
               type: "success",
               message: "操作成功!"
             });
-            this.$refs.crud.toggleSelection();
           });
       },
+
       beforeOpen(done, type) {
         if (["edit", "view"].includes(type)) {
           getDetail(this.form.id).then(res => {
@@ -324,19 +648,20 @@
         this.query = {};
         this.onLoad(this.page);
       },
+        // 搜索
       searchChange(params, done) {
         this.query = params;
         this.page.currentPage = 1;
+          params.createTimeSelect = params.createTime
+          delete params.createTime
         this.onLoad(this.page, params);
         done();
       },
-      selectionChange(list) {
-        this.selectionList = list;
-      },
-      selectionClear() {
-        this.selectionList = [];
-        this.$refs.crud.toggleSelection();
-      },
+        // 搜索分类
+        searchChangefun(params){
+            this.page.currentPage = 1;
+            this.onLoad(this.page, params);
+        },
       currentChange(currentPage){
         this.page.currentPage = currentPage;
       },
@@ -346,19 +671,82 @@
       refreshChange() {
         this.onLoad(this.page, this.query);
       },
+        // 查询列表接口
       onLoad(page, params = {}) {
-        // this.loading = true;
-        // getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
-        //   const data = res.data.data;
-        //   this.page.total = data.total;
-        //   this.data = data.records;
-        //   this.loading = false;
-        //   this.selectionClear();
-        // });
-      }
+        this.loading = true;
+        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+          const data = res.data.data;
+          this.page.total = data.pages.total;
+          this.data = data.pages.records;
+          this.statistics = data.statistics
+          this.loading = false;
+            this.taskCompletionfun() // 查询统计
+        });
+      },
+        // 查询统计数据
+        taskCompletionfun(){
+            taskCompletion().then(res=>{
+                this.taskCompletionData = res.data.data
+            })
+        },
+
+        //自定义列保存
+        async saveColumnTwo(ref, option, optionBack, code) {
+            /**
+             * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+             * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+             * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+             */
+            const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+            if (inSave) {
+                this.$message.success("保存成功");
+                //关闭窗口
+                this.$refs[ref].$refs.dialogColumn.columnBox = false;
+            }
+        },
+        //自定义列重置
+        async resetColumnTwo(ref, option, optionBack, code) {
+            this[option] = this[optionBack];
+            const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+            if (inSave) {
+                this.$message.success("重置成功");
+                this.$refs[ref].$refs.dialogColumn.columnBox = false;
+            }
+        }
+
     }
   };
 </script>
 
-<style>
+<style scoped>
+    ::v-deep#out-table .back-one {
+        background: #ffc000 !important;
+    }
+    ::v-deep#out-table .back-two {
+        background: #ffc000 !important;
+    }
+    .clearfix {
+        font-size: 18px;
+    }
+    .card-flex {
+        display: flex;
+        align-items: center;
+        font-size: 16px;
+        margin-top: 10px;
+    }
+    .card-flex:first-child {
+        margin: 0;
+    }
+    .card-flexLeft {
+        width: 80px;
+    }
+    .card-flexRight {
+
+    }
+    .bottomStatistics {
+        padding: 10px 20px;
+        font-size: 14px;
+        border-radius: 4px;
+        margin-right: 10px;
+    }
 </style>

+ 349 - 0
src/views/iosBasicData/iosbcountrys/index.vue

@@ -0,0 +1,349 @@
+<template>
+  <basic-container class="page-crad" v-if="flag">
+    <avue-crud :option="option"
+               :data="dataList"
+               ref="crud"
+               v-model="form"
+               :page.sync="page"
+               @row-del="rowDel"
+               @row-update="rowUpdate"
+               :before-open="beforeOpen"
+               :before-close="beforeClose"
+               @row-save="rowSave"
+               @search-change="searchChange"
+               @search-reset="searchReset"
+               @on-load="onLoad"
+               @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 287)"
+               @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 287)"
+               @search-criteria-switch="searchCriteriaSwitch"
+               @tree-load="treeLoad">
+        <template slot-scope="{type,size,row,$index}" slot="menuLeft">
+            <el-button icon="el-icon-plus" type="primary" :size="size" @click="handleAdd">新增</el-button>
+        </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+import {getUser} from "@/api/system/user";
+export default {
+  name: "customerInformation",
+  data() {
+    return {
+      form: {},
+      option: {},
+      optionBack: {
+        addBtn:false,
+        headerAlign: "center",
+        align: "center",
+        border: true,
+        index: true,
+        // lazy: true,
+        stripe: true,
+        height: "auto",
+        tip: false,
+        simplePage: true,
+        searchShow: true,
+        tree: true,
+        searchMenuSpan: 16,
+        searchSpan: 8,
+        searchIcon: true,
+        searchIndex: 2,
+        selection: true,
+        viewBtn: false,
+        menuWidth: 140,
+        column: [{
+          label: "仓库编码",
+          prop: "code",
+          search: true,
+          overHidden: true,
+          // width: 120,
+          rules: [
+            {
+              required: true,
+              message: " ",
+              trigger: "blur"
+            }
+          ]
+        }, {
+          label: "仓库名称",
+          prop: "cname",
+          search: true,
+          overHidden: true,
+          // width: 120,
+          rules: [
+            {
+              required: true,
+              message: " ",
+              trigger: "blur"
+            }
+          ]
+        }, {
+          label: "联系人",
+          prop: "contacts",
+          search: true,
+          overHidden: true,
+          // width: 120,
+          rules: [
+            {
+              required: true,
+              message: " ",
+              trigger: "blur"
+            }
+          ]
+        }, {
+          label: "联系电话",
+          prop: "tel",
+          search: true,
+          overHidden: true,
+          // width: 120,
+          rules: [
+            {
+              required: true,
+              message: " ",
+              trigger: "blur"
+            }
+          ]
+        }, {
+          label: "是否计费",
+          prop: "chargeOrNot",
+          search: true,
+          overHidden: true,
+          // width: 120,
+          type: "select",
+          dicData: [{
+            label: "是",
+            value: 0
+          }, {
+            label: "否",
+            value: 1
+          }],
+        }, {
+          label: "库容",
+          prop: "storageCapacity",
+          search: true,
+          overHidden: true,
+          // width: 120,
+          // rules: [
+          //   {
+          //     required: true,
+          //     message: " ",
+          //     trigger: "blur"
+          //   }
+          // ]
+        }, {
+          label: "所属公司",
+          prop: "salesCompanyId",
+          search: true,
+          overHidden: true,
+            disabled: true,
+          // width: 120,
+          type: 'select',
+          props: {
+            label: 'fullName',
+            value: 'id'
+          },
+          dicUrl: '/api/blade-system/dept/top-list',
+          rules: [
+            {
+              required: true,
+              message: " ",
+              trigger: "blur"
+            }
+          ]
+        }, {
+          label: "备注",
+          prop: "remarks",
+          type: "textarea",
+          minRows: 3,
+          span: 24,
+          overHidden: true,
+          // width: 200
+        }]
+      },
+      parentId: 0,
+      dataList: [],
+        // 请求数据
+      page: {
+        pageSize: 20,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+      },
+      treeDeptId: "",
+      flag:false,
+    };
+  },
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(287), this.optionBack);
+    let i = 0;
+    this.option.column.forEach(item => {
+      if (item.search) i++
+    })
+    if (i % 3 !== 0) {
+      const num = 3 - Number(i % 3)
+      this.option.searchMenuSpan = num * 8;
+      this.option.searchMenuPosition = "right";
+    }
+    setTimeout(()=>{
+      this.flag = true
+    },200)
+  },
+  methods: {
+    //删除列表后面的删除按钮触发触发(row, index, done)
+    rowDel(row, index, done) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          // return deleteDetails(row.id);
+          //   删除接口
+        })
+        .then(() => {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          // 数据回调进行刷新
+          done(row);
+        });
+    },
+    //修改时的修改按钮点击触发
+    rowUpdate(row, index, done, loading) {
+        console.log('修改触发')
+      // typeSave(row).then(
+      //   () => {
+      //     this.$message({
+      //       type: "success",
+      //       message: "操作成功!"
+      //     });
+      //     // 数据回调进行刷新
+      //     done(row);
+      //   },
+      //   error => {
+      //     window.console.log(error);
+      //     loading();
+      //   }
+      // );
+    },
+    //新增修改时保存触发
+    rowSave(row, done, loading) {
+      console.log(row,'修改保存');
+      // typeSave(row).then(res => {
+      //     console.log(res);
+      //     this.page.currentPage = 1;
+      //     this.onLoad(this.page, {});
+      //     done();
+      //   },
+      //   error => {
+      //     window.console.log(error);
+      //     loading();
+      //   }
+      // );
+    },
+    //新增按钮触发
+    handleAdd(row) {
+      // this.parentId = row.id;
+      // const column = this.findObject(this.option.column, "parentId");
+      // column.value = row.id;
+      // column.addDisabled = true;
+        getUser(JSON.parse(localStorage.getItem('saber-userInfo')).content.user_id).then(res=>{
+            this.form.salesCompanyName = res.data.data.deptName
+            this.form.salesCompanyId = res.data.data.deptId
+        })
+      this.$refs.crud.rowAdd();
+    },
+    //新增子项和新增触发查询所有
+    beforeOpen(done, type) {
+      if (["add", "edit"].includes(type)) {
+        this.option.column.forEach(e => {
+          if (e.prop == "storageTypeId") {
+            this.$set(this.option.column, 3, { ...e, value: this.treeDeptId });
+          }
+        });
+      }
+        console.log('查询明细')
+      // if (["edit", "view"].includes(type)) {
+      //   detail(this.form.id).then(res => {
+      //     this.form = res.data.data;
+      //   });
+      // }
+      done();
+    },
+    //点击新增时触发
+    beforeClose(done) {
+      this.parentId = "";
+      // const column = this.findObject(this.option.column, "parentId");
+      // column.value = "";
+      // column.addDisabled = false;
+      done();
+    },
+    //点击搜索按钮触发
+    searchChange(params, done) {
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    searchReset() {
+      this.query = {};
+      this.treeDeptId = "";
+      this.onLoad(this.page);
+    },
+    onLoad(page, params = { parentId: 0 }) {
+      let queryParams = Object.assign({}, params, {
+        size: page.pageSize,
+        current: page.currentPage,
+        parentId: 0,
+        storageTypeId: this.treeDeptId
+      });
+      // customerList(queryParams).then(res => {
+      //   this.dataList = res.data.data.records;
+      //   this.page.total = res.data.data.total;
+      // });
+    },
+    searchCriteriaSwitch(type) {
+      this.$refs.crud.doLayout();
+      this.$refs.crud.getTableHeight();
+    },
+    //树桩列点击展开触发
+    treeLoad(tree, treeNode, resolve) {
+      const parentId = tree.id;
+      // customerList({ parentId: parentId }).then(res => {
+      //   resolve(res.data.data.records);
+      // });
+    },
+
+    //自定义列保存
+    async saveColumnTwo(ref, option, optionBack, code) {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    },
+    //自定义列重置
+    async resetColumnTwo(ref, option, optionBack, code) {
+      this[option] = this[optionBack];
+      const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    }
+  }
+};
+</script>
+
+<style scoped>
+.page-crad ::v-deep .basic-container__card {
+  height: 94.8vh;
+}
+</style>