Procházet zdrojové kódy

Merge remote-tracking branch 'origin/dev' into dev

lichao před 3 roky
rodič
revize
0de9ec1eee

+ 2 - 2
src/api/basicData/configuration.js

@@ -23,10 +23,10 @@ export function detail(data) {
         method: 'get'
     })
 }
-//客户资料列表删除
+//国内销售列表删除
 export function deleteDetails(data) {
     return request({
-        url: '/api/blade-client/corpsdesc/update',
+        url: '/api/blade-purchase-sales/order/update',
         method: 'post',
         data: {
             id:data

+ 87 - 0
src/api/basicData/container.js

@@ -0,0 +1,87 @@
+import request from '@/router/axios';
+
+//港口类型
+export const getTypeList = (param) => {
+  return request({
+    url: '/api/blade-client/container/type/list',
+    method: 'get',
+    params: param
+  })
+}
+
+export const typeRemove = (id) => {
+  return request({
+    url: '/api/blade-client/container/type/delete',
+    method: 'delete',
+    params: {
+      id:id
+    }
+  })
+}
+
+export const typeAdd = (row) => {
+  return request({
+    url: '/api/blade-client/container/type/add',
+    method: 'post',
+    data: row
+  })
+}
+
+export const typeUpdate = (row) => {
+  return request({
+    url: '/api/blade-client/container/type/edit',
+    method: 'post',
+    data: row
+  })
+}
+
+//港口列表
+export const getList = (current, size, params) => {
+  return request({
+    url: '/api/blade-client/container/list',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const add = (row) => {
+  return request({
+    url: '/api/blade-client/container/add',
+    method: 'post',
+    data : row
+  })
+}
+
+export const update = (row) => {
+  return request({
+    url: '/api/blade-client/container/edit',
+    method: 'put',
+    data : row
+  })
+}
+
+export const remove = (id) => {
+  return request({
+    url: '/api/blade-client/container/delete',
+    method: 'delete',
+    data: {
+      id:id
+    }
+  })
+}
+
+export const getPortTypeTree = (pid) => {
+  return request({
+    url: '/api/blade-client/port/getPortTypeList',
+    method: 'get',
+    params: {
+      pid
+    }
+  })
+}
+
+

+ 87 - 0
src/api/basicData/portinformation.js

@@ -0,0 +1,87 @@
+import request from '@/router/axios';
+
+//港口类型
+export const getTypeList = (param) => {
+  return request({
+    url: '/api/blade-client/port/type/list',
+    method: 'get',
+    params: param
+  })
+}
+
+export const typeRemove = (id) => {
+  return request({
+    url: '/api/blade-client/port/type/delete',
+    method: 'delete',
+    params: {
+      id:id
+    }
+  })
+}
+
+export const typeAdd = (row) => {
+  return request({
+    url: '/api/blade-client/port/type/add',
+    method: 'post',
+    data: row
+  })
+}
+
+export const typeUpdate = (row) => {
+  return request({
+    url: '/api/blade-client/port/type/edit',
+    method: 'post',
+    data: row
+  })
+}
+
+//港口列表
+export const getList = (current, size, params) => {
+  return request({
+    url: '/api/blade-client/port/list',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const add = (row) => {
+  return request({
+    url: '/api/blade-client/port/add',
+    method: 'post',
+    data : row
+  })
+}
+
+export const update = (row) => {
+  return request({
+    url: '/api/blade-client/port/edit',
+    method: 'put',
+    data : row
+  })
+}
+
+export const remove = (id) => {
+  return request({
+    url: '/api/blade-client/port/delete',
+    method: 'delete',
+    data: {
+      id:id
+    }
+  })
+}
+
+export const getPortTypeTree = (pid) => {
+  return request({
+    url: '/api/blade-client/port/getPortTypeList',
+    method: 'get',
+    params: {
+      pid
+    }
+  })
+}
+
+

+ 106 - 0
src/views/basicData/container/configuration/typeOption.json

@@ -0,0 +1,106 @@
+{
+  "headerAlign": "center",
+  "align": "center",
+  "border": true,
+  "index": true,
+  "lazy": true,
+  "tip": false,
+  "simplePage": true,
+  "searchShow": true,
+  "searchMenuPosition": "right",
+  "searchMenuSpan": 12,
+  "tree": true,
+  "selection": true,
+  "viewBtn": true,
+  "menuWidth": 300,
+  "labelWidth": 120,
+  "searchLabelWidth": 120,
+  "column": [
+    {
+      "label": "集装箱类型",
+      "prop": "name",
+      "search": true,
+      "index": 1,
+      "overHidden": true,
+      "rules": [
+        {
+          "required": true,
+          "message": " ",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "上级类型",
+      "prop": "parentId",
+      "dicData": [],
+      "type": "tree",
+      "hide": true,
+      "overHidden": true,
+      "props": {
+        "label": "cname",
+        "value": "id"
+      },
+      "rules": [{
+        "required": false,
+        "message": " ",
+        "trigger": "click"
+      }]
+    },
+    {
+      "label": "排序",
+      "prop": "sort",
+      "type": "number",
+      "index": 6,
+      "overHidden": true,
+      "rules": [{
+        "required": true,
+        "message": " ",
+        "trigger": "blur"
+      }]
+    },
+    {
+      "label": "状态",
+      "type": "select",
+      "prop": "status",
+      "search": true,
+      "index": 2,
+      "overHidden": true,
+      "value": 0,
+      "dicData": [{
+        "label": "正常",
+        "value": 0
+      }, {
+        "label": "关闭",
+        "value": 1
+      }],
+      "rules": [
+        {
+          "required": true,
+          "message": " ",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "创建人",
+      "prop": "createUserName",
+      "index": 4,
+      "overHidden": true,
+      "addDisplay": false,
+      "editDisplay":false
+    },
+    {
+      "label": "创建时间",
+      "prop": "createTime",
+      "type": "date",
+      "format": "yyyy-MM-dd HH:ss",
+      "valueFormat": "yyyy-MM-dd",
+      "overHidden": true,
+      "searchRange":true,
+      "addDisplay": false,
+      "editDisplay":false,
+      "index": 5
+    }
+  ]
+}

+ 173 - 0
src/views/basicData/container/type.vue

@@ -0,0 +1,173 @@
+<template>
+  <basic-container>
+    <avue-crud :option="option"
+               :data="dataList"
+               ref="crud"
+               v-model="form"
+               :table-loading="loading"
+               :page.sync="page"
+               :search.sync="search"
+               @row-del="rowDel"
+               @row-update="rowUpdate"
+               :before-open="beforeOpen"
+               :before-close="beforeClose"
+               @row-save="rowSave"
+               @search-change="searchChange"
+               @refresh-change="refreshChange"
+               @on-load="onLoad"
+               @tree-load="treeLoad"
+    >
+      <template slot-scope="scope" slot="menu">
+        <el-button
+          type="text"
+          icon="el-icon-circle-plus-outline"
+          size="small"
+          @click.stop="handleAdd(scope.row,scope.index)"
+        >新增子项
+        </el-button>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+  import option from "./configuration/typeOption.json";
+  import {getTypeList , typeRemove ,typeAdd ,typeUpdate} from "@/api/basicData/container"
+
+  export default {
+    data() {
+      return {
+        form: {},
+        search:{},//搜索表单
+        option: option,
+        parentId:0,
+        loading:true,
+        dataList: [],
+        page: {
+          pageSize: 10,
+          pagerCount: 5,
+          total: 0,
+        },
+        query:{}
+      }
+    },
+    created() {
+
+    },
+    mounted() {
+      option.height = window.innerHeight - 310 ;
+    },
+    methods: {
+      onLoad(page, params = {}) {
+        this.loading = true;
+        let param = {
+          ...params,
+          current:this.page.currentPage,
+          size:this.page.pageSize,
+          parentId:0
+        };
+        getTypeList(param).then(res => {
+          this.dataList = res.data.data.records
+          this.page.total = res.data.data.total
+          this.loading=false;
+        })
+      },
+      refreshChange() {
+        this.loading=true;
+        this.onLoad(this.page,this.search);
+      },
+      //删除列表后面的删除按钮触发触发(row, index, done)
+      rowDel(row, index, done) {
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          return typeRemove(row.id);
+        }).then(() => {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          // 数据回调进行刷新
+          done(row);
+        });
+      },
+      //新增时保存触发
+      rowSave(row, done, loading) {
+        typeAdd(row).then(res => {
+          this.onLoad(this.page, {parentId: 0});
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done()
+        })
+      },
+      //修改时的修改按钮点击触发
+      rowUpdate(row, index, done, loading) {
+        typeUpdate(row).then(() => {
+          this.onLoad(this.page, {parentId: 0});
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          // 数据回调进行刷新
+          done(row);
+        }, error => {
+          window.console.log(error);
+          loading();
+        });
+      },
+      //新增修改时给类型赋值
+      initData(){
+        getTypeList({parentId:0}).then(res => {
+          const column = this.findObject(this.option.column, "parentId");
+          column.dicData = res.data.data.records;
+        });
+      },
+      //新增子项触发
+      handleAdd(row) {
+        this.parentId = row.id;
+        const column = this.findObject(this.option.column, "parentId");
+        this.$set(this.form,"parentId",row.id)
+        column.addDisabled = true;
+        this.$refs.crud.rowAdd();
+      },
+      //新增子项和新增触发查询所有
+      beforeOpen(done, type) {
+        if (["add", "edit"].includes(type)) {
+          this.initData();
+        }
+        done();
+      },
+      //点击新增取消时触发
+      beforeClose(done) {
+        this.parentId = "";
+        const column = this.findObject(this.option.column, "parentId");
+        column.value = "";
+        column.addDisabled = false;
+        done();
+      },
+      //点击搜索按钮触发
+      searchChange(params, done) {
+        this.loading = true;
+        this.query = params;
+        this.page.currentPage = 1;
+        this.onLoad(this.page, params);
+        done()
+      },
+      //列表内展开树节点
+      treeLoad(tree, treeNode, resolve) {
+        const parentId = tree.id;
+        getTypeList({parentId:parentId}).then(res => {
+          resolve(res.data.data.records);
+        });
+      },
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 17 - 32
src/views/basicData/portinformation/configuration/mainList.json

@@ -16,16 +16,8 @@
   "menuWidth": 220,
   "column": [
     {
-      "label": "港口类型",
-      "prop": "havenName",
-      "search": true,
-      "index": 1,
-      "width": 120
-    },
-    {
       "label": "港口编号",
-      "prop": "fNo",
-      "index": 2,
+      "prop": "code",
       "width": 150,
       "rules": [
         {
@@ -36,10 +28,9 @@
       ]
     },
     {
-      "label": "港口称",
-      "prop": "fName",
+      "label": "港口称",
+      "prop": "name",
       "search": true,
-      "index": 3,
       "width": 150,
       "rules": [
         {
@@ -51,43 +42,43 @@
     },
     {
       "label": "英文全称",
-      "prop": "fEname",
-      "index": 4,
+      "prop": "enName",
       "width": 150
     },
     {
+      "label": "港口类型",
+      "prop": "typeName",
+      "search": true,
+      "width": 120
+    },
+    {
       "label": "航线",
-      "prop": "portName",
-      "index": 5,
+      "prop": "line",
       "width": 120
     },
     {
       "label": "UNCODE",
-      "prop": "fUncode",
-      "index": 6,
+      "prop": "unCode",
       "width": 120
     },
     {
       "label": "国家",
-      "prop": "fCountry",
-      "index": 7,
+      "prop": "country",
       "width": 80
     },
     {
       "label": "省",
-      "prop": "fProvince",
-      "index": 8,
+      "prop": "province",
       "width": 80
     },
     {
       "label": "市",
-      "prop": "fCity",
-      "index": 9,
+      "prop": "city",
       "width": 80
     },
     {
       "label": "状态",
-      "prop": "fStatus",
+      "prop": "status",
       "type": "select",
       "dicData": [{
         "label": "正常",
@@ -97,13 +88,11 @@
         "value": 1
       }],
       "search": true,
-      "index": 10,
       "width": 120
     },
     {
       "label": "备注",
-      "prop": "remark",
-      "index": 11,
+      "prop": "remarks",
       "width": 150
     },
     {
@@ -111,7 +100,6 @@
       "prop": "createBy",
       "addDisplay": false,
       "editDisplay":false,
-      "index": 12,
       "width": 120
     },
     {
@@ -119,7 +107,6 @@
       "prop": "createTime",
       "addDisplay": false,
       "editDisplay":false,
-      "index": 13,
       "width": 150
     },
     {
@@ -127,7 +114,6 @@
       "prop": "updateBy",
       "addDisplay":false,
       "editDisplay":false,
-      "index": 14,
       "width": 120
     },
     {
@@ -135,7 +121,6 @@
       "prop": "updateTime",
       "addDisplay": false,
       "editDisplay":false,
-      "index": 15,
       "width": 150
     }
   ]

+ 104 - 0
src/views/basicData/portinformation/configuration/typeOption.json

@@ -0,0 +1,104 @@
+{
+  "headerAlign": "center",
+  "align": "center",
+  "border": true,
+  "index": true,
+  "lazy": true,
+  "tip": false,
+  "simplePage": true,
+  "searchShow": true,
+  "searchMenuPosition": "right",
+  "searchMenuSpan": 12,
+  "tree": true,
+  "selection": true,
+  "viewBtn": true,
+  "menuWidth": 300,
+  "column": [
+    {
+      "label": "港口类型",
+      "prop": "name",
+      "search": true,
+      "overHidden": true,
+      "rules": [
+        {
+          "required": true,
+          "message": " ",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "上级类型",
+      "prop": "parentId",
+      "dicData": [],
+      "type": "tree",
+      "hide": true,
+      "overHidden": true,
+      "props": {
+        "label": "name",
+        "value": "id"
+      },
+      "rules": [{
+        "required": false,
+        "message": " ",
+        "trigger": "click"
+      }]
+    },
+    {
+      "label": "排序",
+      "prop": "sort",
+      "type": "number",
+      "overHidden": true,
+      "rules": [{
+        "required": true,
+        "message": " ",
+        "trigger": "blur"
+      }]
+    },
+    {
+      "label": "状态",
+      "type": "select",
+      "prop": "status",
+      "search": true,
+      "overHidden": true,
+      "value": 0,
+      "dicData": [{
+        "label": "正常",
+        "value": 0
+      }, {
+        "label": "关闭",
+        "value": 1
+      }],
+      "rules": [
+        {
+          "required": true,
+          "message": " ",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "备注",
+      "prop": "remarks",
+      "overHidden": true
+    },
+    {
+      "label": "创建人",
+      "prop": "createUserName",
+      "overHidden": true,
+      "addDisplay": false,
+      "editDisplay":false
+    },
+    {
+      "label": "创建时间",
+      "prop": "createTime",
+      "type": "date",
+      "format": "yyyy-MM-dd HH:ss",
+      "valueFormat": "yyyy-MM-dd",
+      "overHidden": true,
+      "searchRange":true,
+      "addDisplay": false,
+      "editDisplay":false
+    }
+  ]
+}

+ 195 - 78
src/views/basicData/portinformation/index.vue

@@ -1,118 +1,235 @@
 <template>
-  <basic-container>
-    <avue-crud :option="option"
-               :data="dataList"
-               ref="crud"
-               v-model="form"
-               :page.sync="page"
-               @row-del="rowDel"
-               @search-change="searchChange"
-               @search-reset="searchReset"
-               @selection-change="selectionChange"
-               @current-change="currentChange"
-               @size-change="sizeChange"
-               @refresh-change="refreshChange"
-               @on-load="onLoad">
-      <template slot="menuLeft">
-        <el-button
-          icon="el-icon-printer"
-          size="small"
-          type="primary"
-          @click.stop=""
-        >报 表
-        </el-button>
-      </template>
-    </avue-crud>
-  </basic-container>
+  <el-row>
+    <el-col :span="4">
+      <div class="box">
+        <el-scrollbar>
+          <basic-container>
+            <avue-tree
+              :option="treeOption"
+              :data="treeData"
+              @node-click="nodeClick"
+            />
+          </basic-container>
+        </el-scrollbar>
+      </div>
+    </el-col>
+    <el-col :span="20">
+      <basic-container>
+        <avue-crud
+          ref="crud"
+          :data="data"
+          :option="tableOption"
+          :page.sync="page"
+          :table-loading="loading"
+          v-model='form'
+          :search.sync="search"
+          :before-open="beforeOpen"
+          @size-change="sizeChange"
+          @current-change="currentChange"
+          @search-change="searchChange"
+          @refresh-change="refreshChange"
+          @row-save="rowSave"
+          @row-del="rowDel"
+          @row-update="rowUpdate"
+          @cell-dblclick="cellDblclick"
+          @on-load="getList"
+          @saveColumn="saveColumn"
+          @tree-load="treeLoad"
+        >
+          <template slot="menuLeft">
+            <el-button
+              icon="el-icon-printer"
+              size="small"
+              type="primary"
+              @click.stop="openReport()"
+            >报 表
+            </el-button>
+          </template>
+          <report-dialog
+            :switchDialog="switchDialog"
+            @onClose="onClose()"
+          ></report-dialog>
+        </avue-crud>
+      </basic-container>
+    </el-col>
+  </el-row>
 </template>
 
 <script>
   import option from "./configuration/mainList.json";
+  import reportDialog from "@/components/report-dialog/main";
+  import {getList , add ,update ,remove ,getPortTypeTree} from "@/api/basicData/portinformation"
 
   export default {
-    name: "customerInformation",
     data() {
       return {
-        form: {},
-        option: option,
-        parentId:0,
-        dataList: [],
+        switchDialog:false,//报表
+        loading: true,
+        data: [],
+        tableOption: option,
+        form:{},
+        search:{},
+        treeDeptId:"",
+        treeDeptName:'',
+        height: window.innerHeight - 350,
         page: {
-          pageSize: 10,
-          pagerCount: 5,
+          currentPage: 1,
           total: 0,
+          pageSize: 10
         },
-        query:{}
-      }
+        treeOption: {
+          nodeKey: "id",
+          lazy: true,
+          treeLoad: function(node, resolve) {
+            const parentId = node.level === 0 ? 0 : node.data.id;
+            getPortTypeTree(parentId).then(res => {
+              resolve(
+                res.data.map(item => {
+                  return {
+                    ...item,
+                    leaf: !item.hasChildren
+                  };
+                })
+              );
+            });
+          },
+          addBtn: false,
+          menu: false,
+          size: "small",
+          props: {
+            labelText: "标题",
+            label: "name",
+            value: "id",
+            children: "children"
+          }
+        }
+      };
     },
     created() {
 
     },
+    components: {
+      reportDialog
+    },
     mounted() {
       option.height = window.innerHeight - 350 ;
+      //查询服务类别字典项
+      // getDeptTree().then(res => {
+      //   this.findObject(this.tableOption.column, "goodsTypeId").dicData = res.data.data;
+      // });
     },
     methods: {
-      //删除列表后面的删除按钮触发触发(row, index, done)
-      rowDel(row, index, done) {
+      //打印
+      openReport() {
+        this.switchDialog =! this.switchDialog;
+      },
+      //关闭打印
+      onClose(val) {
+        this.switchDialog = val;
+      },
+      getList(page, params = {}) {
+        this.loading = true
+        getList(page.currentPage, page.pageSize, params, this.treeDeptId).then(res => {
+          this.data = res.data.data.records
+          this.page.total = res.data.data.total
+          this.loading = false
+        })
+      },
+      //点击新增打开的窗口 取消时触发
+      // beforeClose(){
+
+      // },
+      //点击新增或修改时
+      beforeOpen(done, type){
+        if (["add"].includes(type)) {
+          this.tableOption.column.forEach(e=>{
+            if(e.prop=='typeName'){
+              this.$set(this.tableOption.column,4,{...e,value:this.treeDeptId})
+            }
+          })
+        }
+        done();
+      },
+      searchChange(params, done) {
+        this.getList(this.page, params);
+        done();
+      },
+      sizeChange(val) {
+        this.page.pageSize = val;
+        this.getList();
+      },
+      currentChange(val) {
+        this.page.currentPage = val;
+        this.getList();
+      },
+      refreshChange() {
+        this.getList(this.page,this.search);
+      },
+      rowSave(row, done, loading) {
+        add(row).then(() => {
+          this.page.currentPage = 1;
+          this.getList(this.page);
+          this.$message.success("保存成功");
+          done()
+        }, error => {
+          window.console.log(error);
+          loading();
+        });
+      },
+      rowUpdate(row, index, done, loading) {
+        row.createTime = '';
+        update(row).then(() => {
+          this.getList(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          // 数据回调进行刷新
+          done(row);
+        }, error => {
+          window.console.log(error);
+          loading();
+        });
+      },
+      rowDel(row, index,done) {
         this.$confirm("确定将选择数据删除?", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           type: "warning"
         }).then(() => {
+          return remove(row.id);
+        }).then(() => {
           this.$message({
             type: "success",
             message: "操作成功!"
           });
-          // 数据回调进行刷新
+          this.getList(this.page);
           done(row);
         });
       },
-      //点击搜索按钮触发
-      searchChange(params, done) {
-        this.query = params;
-        this.page.currentPage = 1;
-        params.parentId = 0
-        this.onLoad(this.page, params);
-        done()
-      },
-      searchReset() {
-        console.log('1')
-      },
-      selectionChange() {
-        console.log('1')
-      },
-      currentChange() {
-        console.log('1')
+      cellDblclick(row, column, cell, event) {
+        this.$refs.crud.rowEdit(row);
       },
-      sizeChange() {
-        console.log('1')
+      saveColumn(row, column) {
+        console.log(row, column);
       },
-      refreshChange() {
-        console.log('1')
+      //展开主页左边类型
+      nodeClick(data) {
+        this.treeDeptName = data.cname;
+        this.treeDeptId = data.id;
+        this.page.currentPage = 1;
+        this.getList(this.page);
       },
-      onLoad(page, params = {}) {
-        this.dataList = [{
-          havenName:"海港",
-          fNo:"DD",
-          fName:"丹东",
-          fEname:"dandong",
-          portName:"威海-丹东",
-          fUncode:"CEWEI",
-          fCountry:"中国",
-          fProvince:"山东",
-          fCity:"威海",
-          fStatus:"正常使用",
-          remark:"123",
-          createBy:"admin",
-          createTime:"2021-04-16",
-          updateBy:"admin",
-          updateTime:"2021-04-16",
-        }];
+      //列表内展开树节点
+      treeLoad(tree, treeNode, resolve) {
+        const parentId = tree.id;
+        getList({parentId:parentId}).then(res => {
+          resolve(res.data.data.records);
+        });
       },
     }
-  }
+  };
 </script>
 
-<style scoped>
-
+<style scoped lang="scss">
 </style>

+ 173 - 0
src/views/basicData/portinformation/type.vue

@@ -0,0 +1,173 @@
+<template>
+  <basic-container>
+    <avue-crud :option="option"
+               :data="dataList"
+               ref="crud"
+               v-model="form"
+               :table-loading="loading"
+               :page.sync="page"
+               :search.sync="search"
+               @row-del="rowDel"
+               @row-update="rowUpdate"
+               :before-open="beforeOpen"
+               :before-close="beforeClose"
+               @row-save="rowSave"
+               @search-change="searchChange"
+               @refresh-change="refreshChange"
+               @on-load="onLoad"
+               @tree-load="treeLoad"
+    >
+      <template slot-scope="scope" slot="menu">
+        <el-button
+          type="text"
+          icon="el-icon-circle-plus-outline"
+          size="small"
+          @click.stop="handleAdd(scope.row,scope.index)"
+        >新增子项
+        </el-button>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+  import option from "./configuration/typeOption.json";
+  import {getTypeList , typeRemove ,typeAdd ,typeUpdate} from "@/api/basicData/portinformation"
+
+  export default {
+    data() {
+      return {
+        form: {},
+        search:{},//搜索表单
+        option: option,
+        parentId:0,
+        loading:true,
+        dataList: [],
+        page: {
+          pageSize: 10,
+          pagerCount: 5,
+          total: 0,
+        },
+        query:{}
+      }
+    },
+    created() {
+
+    },
+    mounted() {
+      option.height = window.innerHeight - 310 ;
+    },
+    methods: {
+      onLoad(page, params = {}) {
+        this.loading = true;
+        let param = {
+          ...params,
+          current:this.page.currentPage,
+          size:this.page.pageSize,
+          parentId:0
+        };
+        getTypeList(param).then(res => {
+          this.dataList = res.data.data.records
+          this.page.total = res.data.data.total
+          this.loading=false;
+        })
+      },
+      refreshChange() {
+        this.loading=true;
+        this.onLoad(this.page,this.search);
+      },
+      //删除列表后面的删除按钮触发触发(row, index, done)
+      rowDel(row, index, done) {
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          return typeRemove(row.id);
+        }).then(() => {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          // 数据回调进行刷新
+          done(row);
+        });
+      },
+      //新增时保存触发
+      rowSave(row, done, loading) {
+        typeAdd(row).then(res => {
+          this.onLoad(this.page, {parentId: 0});
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done()
+        })
+      },
+      //修改时的修改按钮点击触发
+      rowUpdate(row, index, done, loading) {
+        typeUpdate(row).then(() => {
+          this.onLoad(this.page, {parentId: 0});
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          // 数据回调进行刷新
+          done(row);
+        }, error => {
+          window.console.log(error);
+          loading();
+        });
+      },
+      //新增修改时给类型赋值
+      initData(){
+        getTypeList({parentId:0}).then(res => {
+          const column = this.findObject(this.option.column, "parentId");
+          column.dicData = res.data.data.records;
+        });
+      },
+      //新增子项触发
+      handleAdd(row) {
+        this.parentId = row.id;
+        const column = this.findObject(this.option.column, "parentId");
+        this.$set(this.form,"parentId",row.id)
+        column.addDisabled = true;
+        this.$refs.crud.rowAdd();
+      },
+      //新增子项和新增触发查询所有
+      beforeOpen(done, type) {
+        if (["add", "edit"].includes(type)) {
+          this.initData();
+        }
+        done();
+      },
+      //点击新增取消时触发
+      beforeClose(done) {
+        this.parentId = "";
+        const column = this.findObject(this.option.column, "parentId");
+        column.value = "";
+        column.addDisabled = false;
+        done();
+      },
+      //点击搜索按钮触发
+      searchChange(params, done) {
+        this.loading = true;
+        this.query = params;
+        this.page.currentPage = 1;
+        this.onLoad(this.page, params);
+        done()
+      },
+      //列表内展开树节点
+      treeLoad(tree, treeNode, resolve) {
+        const parentId = tree.id;
+        getTypeList({parentId:parentId}).then(res => {
+          resolve(res.data.data.records);
+        });
+      },
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 9 - 2
src/views/workManagement/main-items/configuration/detailsPage.json

@@ -39,7 +39,7 @@
       "label": "任务部门",
       "prop": "deptid",
       "type":"tree",
-      "dicUrl": "/api/blade-system/dept/tree?tenantId=",
+      "dicUrl": "/api/blade-system/dept/tree?tenantId=096359",
       "props": {
         "label": "title",
         "value": "value"
@@ -77,7 +77,14 @@
       "label": "合计金额",
       "prop": "amount",
       "width": 120,
-      "cell": true
+      "cell": true,
+      "rules": [
+        {
+          "required": true,
+          "message": " ",
+          "trigger": "blur"
+        }
+      ]
     },
     {
       "label": "频率",

+ 38 - 23
src/views/workManagement/main-items/detailsPage.vue

@@ -5,14 +5,13 @@
         <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
                    @click="backToList">返回列表
         </el-button>
-        <el-button type="primary"
+        <el-button type="success"
                    class="el-button--small-yh add-customer-btn-two"
-                   icon="el-icon-plus"
-                   @click.stop="addMainProject">新 单
+                   @click.stop="addMainProject">复制新单
         </el-button>
         <el-button class="el-button--small-yh add-customer-btn" type="primary"
                    @click.stop="editMainProject"
-        >{{this.id?"确认修改" :"确认保存"}}
+        >{{this.id?"确认修改" :"确认新增"}}
         </el-button>
       </div>
     </div>
@@ -63,7 +62,7 @@
             <el-button type="primary"
                        size="small"
                        icon="el-icon-plus"
-                       @click="serviceDialog = true">新增明细
+                       @click="serviceDialog = true">录入明细
             </el-button>
             <el-button type="info"
                        size="small"
@@ -72,11 +71,10 @@
           </template>
           <template slot="menuRight">
             <el-button
-              icon="el-icon-printer"
               size="small"
-              type="primary"
+              type="info"
               @click.stop="openReport()"
-            >报表
+            >导出报表
             </el-button>
           </template>
           <template slot-scope="{row,index}"  slot="menu">
@@ -472,6 +470,7 @@
       this.optionTable.column[7].change = function (val) {
         val.row.amount = val.row.price*val.value;
       }
+
       this.$set(this.form,"debitAmount",0)
       this.$set(this.form,"advanceAmount",0)
       this.$set(this.form,"settlmentAmount",0)
@@ -494,7 +493,10 @@
         if(this.id){
           projectDetail(this.id,"0,1,2,3,4,5").then(res =>{
             this.form = res.data.data;
-            this.upLoadData =res.data.data.filesList
+            this.configuration.dicData = res.data.data.corpName;
+            if(res.data.data.filesList){
+              this.upLoadData = res.data.data.filesList
+            }
             if(res.data.data.itemList){
               this.data = res.data.data.itemList;
               let status = [];
@@ -592,20 +594,33 @@
       //请核
       beforePleaseCheck(){
         if(this.crudSelection.length!=0){
+          let resultUserName = [];
           let result = [];
           this.crudSelection.forEach(item=>{
             // 新录入状态下  才可提交审核
-            item.status == 0 ? result.push(true) : result.push(false)
+            item.createUserName ? resultUserName.push(true) : resultUserName.push(false) //如果没有创建人并且为新录入  提示保存
+            item.strStatus === "录入" ? result.push(true) : result.push(false) //判断所有的是否为录入状态
           })
-          //如果数组内有一个 为false  则为false
-          if(result.findIndex(item => item != true) == -1){
-            this.editMainProject(10086);
+          if(resultUserName.findIndex(item => item != true) == -1){
+            // 如果数组内有一个 为false  则为false
+            if(result.findIndex(item => item != true) == -1){
+              this.editMainProject(10086);
+            }else{
+              this.$message({
+                type: "error",
+                message: "请核数据中存在已请核数据!"
+              });
+              return
+            }
           }else{
-            this.$message({
-              type: "error",
-              message: "请核数据中存在已请核数据!"
-            });
-            return;
+            this.$confirm("列表内存在新录入数据,是否先保存此数据?", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning"
+            }).then(() => {
+              this.editMainProject();
+              return
+            })
           }
         }else{
           this.$message({
@@ -641,9 +656,9 @@
         this.$refs["form"].validate((valid) => {
           //校验明细列表
           let valids = true;
-          if(this.crudSelection.length != 0 ){
-            this.crudSelection.forEach((item) =>{
-              if((item.userid ==""  || !item.deptid) && valids){
+          if(this.data.length !=0){
+            this.data.forEach((item) =>{
+              if((item.userid ==""  || !item.deptid || !item.amount) && valids){
                 this.$message({
                   type: "warning",
                   message: "请检查明细列表第 "+(item.$index +1 )+" 行必填项"
@@ -674,8 +689,8 @@
                 this.data = []
                 this.upLoadData = []
                 this.id = ''
-              }else{
-                this.getProjectDetail(pleaseCheck);
+              }else if(pleaseCheck === 10086){
+                this.getProjectDetail(pleaseCheck)
               }
             })
           }

+ 8 - 4
src/views/workManagement/main-items/list.vue

@@ -22,11 +22,15 @@
                    icon="el-icon-plus"
                    @click="addMainItems">新 单
         </el-button>
-        <el-button icon="el-icon-printer"
-                   size="small"
-                   type="primary"
+        <el-button size="small"
+                   type="success"
+                   @click.stop=""
+        >复制新单
+        </el-button>
+        <el-button size="small"
+                   type="info"
                    @click.stop="openReport()"
-          >报 表
+          >导出报表
         </el-button>
       </template>
       <template slot-scope="scope" slot="menu">

+ 32 - 18
src/views/workManagement/receipt/configuration/settleAccountsDetailsPage.json

@@ -39,12 +39,11 @@
       "label": "任务部门",
       "prop": "deptid",
       "type":"tree",
-      "dicUrl": "/api/blade-system/dept/tree?tenantId=",
+      "dicUrl": "/api/blade-system/dept/tree?tenantId=096359",
       "props": {
         "label": "title",
         "value": "value"
       },
-      "cell": true,
       "slot": true,
       "width": 150,
       "rules": [
@@ -56,28 +55,47 @@
       ]
     },
     {
+      "label": "账户名称",
+      "prop": "accountName",
+      "width": 120
+    },
+    {
+      "label": "开户银行",
+      "prop": "accountBank",
+      "width": 120
+    },
+    {
+      "label": "银行账号",
+      "prop": "accountNo",
+      "width": 120
+    },
+    {
+      "label": "结算日期",
+      "prop": "payTime",
+      "width": 120,
+      "valueFormat": "yyyy-MM-dd",
+      "format": "yyyy-MM-dd",
+      "type": "date"
+    },
+    {
       "label": "单价",
       "prop": "price",
-      "width": 120,
-      "cell": true
+      "width": 120
     },
     {
       "label": "计价单位",
       "prop": "unit",
-      "width": 120,
-      "cell": true
+      "width": 120
     },
     {
       "label": "数量",
       "prop": "quantity",
-      "width": 120,
-      "cell": true
+      "width": 120
     },
     {
       "label": "合计金额",
       "prop": "amount",
-      "width": 120,
-      "cell": true
+      "width": 120
     },
     {
       "label": "频率",
@@ -88,8 +106,7 @@
         "label": "dictValue",
         "value": "dictKey"
       },
-      "width": 120,
-      "cell": true
+      "width": 120
     },
     {
       "label": "提醒日",
@@ -97,8 +114,7 @@
       "valueFormat": "yyyy-MM-dd HH:mm:ss",
       "format": "yyyy-MM-dd",
       "type": "date",
-      "width": 150,
-      "cell": true
+      "width": 150
     },
     {
       "label": "需求开始日期",
@@ -106,8 +122,7 @@
       "valueFormat": "yyyy-MM-dd HH:mm:ss",
       "format": "yyyy-MM-dd",
       "type": "date",
-      "width": 150,
-      "cell": true
+      "width": 150
     },
     {
       "label": "需求完成日期",
@@ -115,8 +130,7 @@
       "valueFormat": "yyyy-MM-dd HH:mm:ss",
       "format": "yyyy-MM-dd",
       "type": "date",
-      "width": 150,
-      "cell": true
+      "width": 150
     },
     {
       "label": "制单人",

+ 79 - 33
src/views/workManagement/receipt/settleAccountsDetailsPage.vue

@@ -5,6 +5,10 @@
         <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
                    @click="backToList">返回列表
         </el-button>
+        <el-button class="el-button--small-yh add-customer-btn" type="primary"
+                   @click.stop="editMainProject"
+        >{{this.id?"确认修改" :"确认新增"}}
+        </el-button>
       </div>
     </div>
     <div style="margin-top: 60px">
@@ -53,6 +57,7 @@
               type="text"
               icon="el-icon-check"
               size="small"
+              v-if="scope.row.status == 4"
               @click.stop="beforeCloseAccount(scope.row,scope.index)"
             >结 算
             </el-button>
@@ -88,20 +93,24 @@
       :close-on-click-modal="false"
       :destroy-on-close="true"
       :close-on-press-escape="false">
-      <el-form v-model="accountFormData">
-        <el-form-item label="账户名称:"  class="landConFrom-input" prop="accountName">
-          <el-input v-model="accountFormData.accountName" style="width: 200px;"></el-input>
+
+      <el-form  :model="accountFormData" ref="accountFormData">
+        <el-form-item label="账户名称"  class="landConFrom-input" prop="accountName" :rules="rules">
+          <el-input v-model="accountFormData.accountName" style="width: 220px;" size="small" clearable  placeholder="请输入" ></el-input>
+        </el-form-item>
+        <el-form-item label="开户银行"  class="landConFrom-input" prop="accountBank" :rules="rules">
+          <el-input v-model="accountFormData.accountBank" style="width: 220px;"  size="small" clearable autocomplete="off" placeholder="请输入" ></el-input>
         </el-form-item>
-        <el-form-item label="开户银行:"  class="landConFrom-input" prop="accountBank">
-          <el-input v-model="accountFormData.accountBank"  style="width: 200px;"></el-input>
+        <el-form-item label="银行账号"  class="landConFrom-input" prop="accountNo"  :rules="rules">
+          <el-input v-model="accountFormData.accountNo" style="width: 220px;" size="small" clearable autocomplete="off" placeholder="请输入" ></el-input>
         </el-form-item>
-        <el-form-item label="银行账号:"  class="landConFrom-input" prop="accountNo">
-          <el-input v-model="accountFormData.accountNo"  style="width: 200px;"></el-input>
+        <el-form-item label="结算日期"  class="landConFrom-input" prop="payTime"  :rules="rules">
+          <el-date-picker type="date" v-model="accountFormData.payTime" value-format="yyyy-MM-dd HH:mm:ss"  size="small" clearable  placeholder="日期" ></el-date-picker>
         </el-form-item>
       </el-form>
       <span slot="footer" style="display: flex; justify-content: center">
           <el-button @click.stop="accountDialog = false , accountFormData = {}" size="small">取 消</el-button>
-          <el-button type="primary"  size="small" @click="closeAccount">结算</el-button>
+          <el-button type="primary"  size="small" @click="closeAccount('accountFormData')">结算</el-button>
       </span>
     </el-dialog>
   </div>
@@ -110,9 +119,12 @@
 <script>
   import option from "./configuration/settleAccountsDetailsPage.json";
   import upLoadOption from "../../exportTrade/purchaseContract/config/uploadList.json";
-  import { projectDetail,updateItemStatus } from "@/api/workManagement/mainProject";
+  import { projectDetail,editMianProject,updateItemStatus } from "@/api/workManagement/mainProject";
   //业务字典
   import { getDictionary } from "@/api/system/dictbiz";
+  //上传附件删除
+  import { corpsbank } from "@/api/basicData/configuration"
+
 
   export default {
     name: "customerInformation",
@@ -123,10 +135,13 @@
         aaccount:{},
         form: {},
         accountFormData:{
-          accountName:'',
-          accountBank:'',
-          accountNo:'',
         },
+        rules:[{
+          required: true,
+          message: ' ',
+          trigger: 'blur'
+        }
+        ],
         option: option,
         parentId:0,
         account:{},
@@ -328,6 +343,9 @@
               this.dataList = res.data.data.itemList;
               this.loading = false;
             }
+            if(res.data.data.filesList){
+              this.upLoadData = res.data.data.filesList
+            }
           })
         }
       },
@@ -336,27 +354,33 @@
         this.aaccount = row;
         this.accountDialog = true;
       },
-      closeAccount(){
-        this.$confirm("确认结算此明细?", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          updateItemStatus(this.aaccount.id,5,
-            this.accountFormData.accountName,
-            this.accountFormData.accountBank,
-            this.accountFormData.accountNo,).then(res =>{
-            if(res.data.success){
-              this.$message({
-                type: "success",
-                message: "操作成功!"
-              });
-              this.accountFormData = {},
-              this.accountDialog = false;
-              this.getProjectDetail();
-            }
-          })
-        });
+      closeAccount(form){
+        this.$refs[form].validate((valid) => {
+          console.log(132)
+          if(valid){
+            this.$confirm("确认结算此明细?", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning"
+            }).then(() => {
+              updateItemStatus(this.aaccount.id,5,
+                this.accountFormData.accountName,
+                this.accountFormData.accountBank,
+                this.accountFormData.accountNo,
+                this.accountFormData.payTime,).then(res =>{
+                if(res.data.success){
+                  this.$message({
+                    type: "success",
+                    message: "操作成功!"
+                  });
+                  this.accountFormData = {},
+                    this.accountDialog = false;
+                  this.getProjectDetail();
+                }
+              })
+            });
+          }
+        })
       },
       //结算
       callAccount(row,index){
@@ -384,6 +408,23 @@
           query: {}
         });
       },
+      //新增 修改
+      editMainProject(){
+        const params = {
+          ...this.form,
+          itemList:this.dataList,
+          filesList:this.upLoadData
+        }
+        editMianProject(params).then(res =>{
+          if(res.data.success){
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.getProjectDetail()
+          }
+        })
+      },
       searchReset() {
         console.log('1')
       },
@@ -457,6 +498,11 @@
   ::v-deep .el-form-item {
     margin-bottom: 0;
   }
+  .add-customer-btn {
+    position: fixed;
+    right: 36px;
+    top: 115px;
+  }
   .landConFrom-input{
     display:flex;
     justify-content:center;

+ 1 - 1
src/views/workManagement/task/configuration/mainList.json

@@ -82,7 +82,7 @@
       "prop": "deptid",
       "search": true,
       "type":"tree",
-      "dicUrl": "/api/blade-system/dept/tree?tenantId=",
+      "dicUrl": "/api/blade-system/dept/tree?tenantId=096359",
       "props": {
         "label": "title",
         "value": "value"