qinbai 3 years ago
parent
commit
befb2a2e26

+ 50 - 0
src/components/selectComponent/configuration/userOption.json

@@ -0,0 +1,50 @@
+{
+    "lazy": true,
+    "tip": false,
+    "simplePage": true,
+    "searchMenuSpan": 12,
+    "dialogWidth": "60%",
+    "searchShowBtn": false,
+    "searchShow": true,
+    "menu": false,
+    "addBtn": false,
+    "tree": true,
+    "border": true,
+    "index": true,
+    "selection": true,
+    "viewBtn": false,
+    "editBtn": false,
+    "delBtn": false,
+    "menuWidth": 300,
+    "dialogClickModal": false,
+    "column":[
+        {
+            "label": "登录账号",
+            "prop": "account",
+            "search": true,
+            "index": 1,
+            "width":120
+        },{
+            "label": "所属租户",
+            "prop": "tenantName",
+            "index": 2,
+            "width":120
+        },{
+            "label": "用户姓名",
+            "prop": "realName",
+            "search": true,
+            "index": 4,
+            "width":150
+        },{
+            "label": "用户平台",
+            "prop": "userTypeName",
+            "index": 5,
+            "width":150
+        },{
+            "label": "用户拓展",
+            "prop": "userExt",
+            "index": 6,
+            "width":180
+        }
+    ]
+}

+ 336 - 0
src/components/selectComponent/userSelect.vue

@@ -0,0 +1,336 @@
+<template>
+  <span class="select-component" style="display:inline-flex;width: 100%;">
+    <el-select
+      v-model.trim="value"
+      size="small"
+      :placeholder="configuration.placeholder"
+      style="border-right: none;width: 100%"
+      :disabled="disabled?disabled:false"
+      :multiple="configuration.multiple?configuration.multiple:false"
+      :clearable="configuration.clearable?configuration.clearable:false"
+      :collapse-tags="configuration.collapseTags?configuration.collapseTags:false"
+      filterable
+      remote
+      @change="changeName()"
+      :remote-method="remoteMethod"
+    >
+      <el-option
+        v-for="item in configuration.dicData.length !== 0?dicData.length !== 0?dicData:configuration.dicData:dicData"
+        :key="item.id"
+        :label="item.realName"
+        :value="item.realName"
+        @click.native="getRow(item)"
+      />
+    </el-select>
+    <el-button slot="append" icon="el-icon-search" size="mini" @click="dialogVisible = true"
+               :disabled="disabled?disabled:false"></el-button>
+  <el-dialog
+    v-dialogdrag
+    title="用户"
+    :fullscreen="dialogFull"
+    :visible.sync="dialogVisible"
+    class="el-dialogDeep"
+    append-to-body
+    width="80%">
+    <template slot="title">
+      <span class="el-dialog__title">
+        <span style="display:inline-block;background-color: #3478f5;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"></span>
+        用户
+      </span>
+      <div style="float: right" class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+        <i class="el-icon-full-screen"></i>
+      </div>
+    </template>
+    <el-row style="height: 0">
+      <el-col :span="5">
+        <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="19">
+        <basic-container>
+          <avue-crud :option="option"
+                     :data="dataList"
+                     ref="crud"
+                     v-model="form"
+                     :page.sync="page"
+                     :table-loading="loadings"
+                     :before-close="beforeClose"
+                     @search-change="searchChange"
+                     @search-reset="searchReset"
+                     @refresh-change="refreshChange"
+                     @selection-change="selectionChange"
+                     @on-load="onLoad"
+                     @saveColumn="saveColumn"
+                     @tree-load="treeLoad">
+          </avue-crud>
+        </basic-container>
+      </el-col>
+    </el-row>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="dialogVisible = false">取 消</el-button>
+      <el-button type="primary" @click="confirmSelection"
+                 :disabled="configuration.multipleChoices === true?false:selection.length === 1?false:true">确 定</el-button>
+    </span>
+  </el-dialog>
+  </span>
+</template>
+
+<script>
+  import option from "./configuration/userOption.json";
+  import { getList } from "@/api/system/user";
+  import { getDeptLazyTree} from "@/api/system/dept";
+
+  export default {
+    name: "index",
+    props: {
+      disabled: Boolean,
+      value: String,
+      configuration: Object,
+    },
+    model: {
+      prop: 'value',
+      event: 'returnBack'
+    },
+    data() {
+      return {
+        dialogFull: false,
+        loadings:false,
+        form: {},
+        dicData: [],
+        dialogVisible: false,
+        value: '',
+        option: option,
+        parentId: 0,
+        dataList: [],
+        selection: [],
+        treeOption: {
+          nodeKey: 'id',
+          lazy: true,
+          treeLoad: function (node, resolve) {
+            const parentId = (node.level === 0) ? 0 : node.data.id;
+            getDeptLazyTree(parentId).then(res => {
+              resolve(res.data.data.map(item => {
+                return {
+                  ...item,
+                  leaf: !item.hasChildren
+                }
+              }))
+            });
+          },
+          addBtn: false,
+          menu: false,
+          size: 'small',
+          props: {
+            labelText: '标题',
+            label: 'title',
+            value: 'value',
+            children: 'children'
+          }
+        },
+        page: {
+          pageSize: 10,
+          pagerCount: 5,
+          total: 0,
+        },
+        // 远程模糊查找loading
+        loading: false,
+        queryParams: {
+          size: 10,
+          current: 1
+        },
+      }
+    },
+    async created() {
+      this.remoteMethod()
+    },
+    methods: {
+      changeName(){
+        this.$emit('returnBack', this.value)
+        let optionList = this.configuration.dicData.length !== 0?this.dicData.length !== 0?this.dicData:this.configuration.dicData:this.dicData;
+        let value ;
+        optionList.map(item =>{
+          if(item.realName === this.value){
+            value = {
+              id : item.id,
+              deptId : item.deptId
+            }
+          }
+        })
+        this.$emit('value',value)
+      },
+      getRow(row) {
+        this.$emit('getRow', row)
+      },
+      //刷新触发
+      refreshChange() {
+        this.page = {
+          pageSize: 10,
+          pagerCount: 5,
+          total: 0,
+        }
+      },
+      //确认导出触发
+      confirmSelection() {
+        this.dicData = []
+        if (this.configuration.multipleChoices === true) {
+          let value = []
+          for (let item in this.selection) {
+            this.dicData.push({realName: this.selection[item].realName})
+            value.push(this.selection[item].realName)
+          }
+          this.value = value
+        } else {
+          this.dicData.push({realName: this.selection[0].realName})
+          this.value = this.selection[0].realName
+        }
+        this.$emit('returnRow', this.selection)
+        this.$emit('returnBack', this.value)
+        this.dialogVisible = false
+        this.$emit('receiveList',this.dicData)
+        let value = {
+          id : this.selection[0].id,
+          deptId : this.selection[0].deptId
+        } ;
+        this.$emit('value',value)
+        this.selection = []
+      },
+      //选中触发
+      selectionChange(selection) {
+        this.selection = selection
+      },
+      nodeClick(data) {
+        this.treeDeptId = data.id;
+        this.page.currentPage = 1;
+        this.onLoad(this.page);
+      },
+      //查询全部
+      initData() {
+        getList().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");
+        column.value = row.id;
+        column.addDisabled = true;
+        this.$refs.crud.rowAdd();
+      },
+      //点击新增时触发
+      beforeClose(done) {
+        this.parentId = "";
+        const column = this.findObject(this.option.column, "parentId");
+        column.value = "";
+        column.addDisabled = false;
+        done();
+      },
+      //点击搜索按钮触发
+      searchChange(params, done) {
+        this.treeDeptId = '';
+        this.page.currentPage = 1;
+        this.onLoad(this.page, params);
+        done()
+      },
+      //搜索重置按钮触发
+      searchReset() {
+        this.treeDeptId = '';
+        this.onLoad(this.page);
+      },
+      onLoad(page, params = {parentId: 0}) {
+        this.loadings = true;
+        getList(page.currentPage, page.pageSize, params,this.treeDeptId).then(res => {
+          this.dataList = res.data.data.records
+          this.page.total = res.data.data.total
+          if (this.page.total) {
+            this.option.height = window.innerHeight - 500;
+          } else {
+            this.option.height = window.innerHeight - 200;
+          }
+        }).finally(()=>{
+          this.loadings = false
+        })
+      },
+      //树桩列点击展开触发
+      treeLoad(tree, treeNode, resolve) {
+        const deptId = tree.id;
+        this.loadings = true;
+        getList(1, 10,deptId).then(res => {
+          resolve(res.data.data.records);
+        }).finally(()=>{
+          this.loadings = false
+        });
+      },
+      // 远程模糊查找
+      remoteMethod(query) {
+        if (query) {
+          this.loading = true;
+          let params = {
+            realName: query
+          }
+          getList(1, 10, params).then(res => {
+            this.dicData = res.data.data.records
+            this.loading = false;
+          });
+        } else {
+          this.loading = true
+          this.queryParams = {
+            size: 10,
+            current: 1
+          }
+          getList(1, 10).then(res => {
+            this.dicData = []
+            this.configuration.dicData.forEach((e,index) => {
+              res.data.data.records.forEach(item => {
+                if (e.realName == item.realName) {
+                  this.configuration.dicData.splice(index, 1)
+                }
+              })
+            })
+            this.configuration.dicData = this.configuration.dicData.concat(res.data.data.records)
+            // this.configuration.dicData = res.data.data.records
+            this.removeRepeat()
+            this.loading = false;
+          });
+        }
+      },
+      // 去重
+      removeRepeat() {
+        let obj = []
+        this.configuration.dicData = this.configuration.dicData.reduce((current,next) => {
+          obj[next.realName] ? '': obj[next.realName] = true && current.push(next)
+          return current
+        }, [])
+      },
+      //列保存触发
+      async saveColumn() {
+        const inSave = await this.saveColumnData(
+          this.getColumnName(49),
+          this.option
+        );
+        if (inSave) {
+          this.$message.success("保存成功");
+          //关闭窗口
+          this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        }
+      },
+    }
+  };
+</script>
+
+<style scoped lang="scss">
+  .el-dialogDeep {
+    ::v-deep .el-dialog {
+      .el-dialog__body, .el-dialog__footer {
+        padding-bottom: 0 !important;
+        padding-top: 0 !important;
+      }
+    }
+  }
+</style>

+ 3 - 0
src/main.js

@@ -37,6 +37,8 @@ import warehouseSelect from '@/components/warehouseSelect/index';
 import goodsSelect from '@/components/goodsSelect/index';
 //费用选择组件
 import breakdownSelect from '@/components/costBreakdown/costBreakdown';
+//用户选择组件
+import userSelect from '@/components/selectComponent/userSelect';
 //枚举列设置名称管理
 import {
   getColumnName
@@ -51,6 +53,7 @@ Vue.component('selectComponent', selectComponent);
 Vue.component('warehouseSelect', warehouseSelect);
 Vue.component('goodsSelect', goodsSelect);
 Vue.component('breakdownSelect', breakdownSelect);
+Vue.component('userSelect', userSelect);
 import portInfo from "@/components/port-info/index";
 Vue.component('portInfo', portInfo);
 // 注册全局crud驱动

+ 3 - 0
src/page/index/tags.vue

@@ -303,6 +303,9 @@ export default {
         if (tag.label == "收款结算") {
           this.$store.commit("RECE_OUT_DETAIL");
         }
+        if (tag.label == "主营项目") {
+          this.$store.commit("MAIN_OUT_DETAIL");
+        }
         this.$store.commit("DEL_TAG", tag);
         if (tag.value === this.tag.value) {
           tag = this.tagList[key === 0 ? key : key - 1]; //如果关闭本标签让前推一个

+ 11 - 9
src/router/views/index.js

@@ -488,18 +488,19 @@ export default [{
       }
     ]
   },
-  // 主营项目详情页
+  // 主营项目
   {
-    path: '/mainItems_detailsPage',
+    path: '/workManagement/main-items/list',
     component: Layout,
     hidden: true,
     children: [
       {
-        path: '/mainItems_detailsPage',
+        path: '/workManagement/main-items/list',
+        name:"主营项目",
         meta: {
-          i18n: 'mainItems_detailsPage'
+          keepAlive:true,
         },
-        component: () => import( /* webpackChunkName: "views" */ '@/views/workManagement/main-items/detailsPage')
+        component: () => import( /* webpackChunkName: "views" */ '@/views/workManagement/main-items/list')
       }
     ]
   },
@@ -520,16 +521,17 @@ export default [{
   },
   // 结算详情页
   {
-    path: '/settleAccounts_detailsPage',
+    path: '/workManagement/receipt/settleAccounts',
     component: Layout,
     hidden: true,
     children: [
       {
-        path: '/settleAccounts_detailsPage',
+        path: '/workManagement/receipt/settleAccounts',
+        name:"结算",
         meta: {
-          i18n: 'settleAccounts_detailsPage'
+          keepAlive:true,
         },
-        component: () => import( /* webpackChunkName: "views" */ '@/views/workManagement/receipt/settleAccountsDetailsPage')
+        component: () => import( /* webpackChunkName: "views" */ '@/views/workManagement/receipt/settleAccounts')
       }
     ]
   },

+ 2 - 1
src/store/getters.js

@@ -34,6 +34,7 @@ const getters = {
   outtaskStatus: state => state.ifdetail.outtaskStatus,
   pqStatus: state => state.ifdetail.pqStatus,
   paySettle: state => state.ifdetail.paySettle,
-  receiptSettle: state => state.ifdetail.receiptSettle
+  receiptSettle: state => state.ifdetail.receiptSettle,
+  mainItemStatus: state => state.ifdetail.mainItemStatus
 }
 export default getters

+ 12 - 0
src/store/modules/ifdetail.js

@@ -9,6 +9,7 @@ const ifdetail = {
     pqStatus: false, //付款
     paySettle:false, //付款结算
     receiptSettle:false, //收款结算
+    mainItemStatus:false, //主营项目明细
   },
   actions: {},
   mutations: {
@@ -91,6 +92,14 @@ const ifdetail = {
     RECE_OUT_DETAIL(state) {
       state.receiptSettle = false;
     },
+    //进入主营项目明细
+    MAIN_IN_DETAIL(state) {
+      state.mainItemStatus = true;
+    },
+    //退出主营项目明细
+    MAIN_OUT_DETAIL(state) {
+      state.mainItemStatus = false;
+    },
     //关闭所有
     DEL_ALL_DETAIL(state) {
       for (let item in state) {
@@ -129,6 +138,9 @@ const ifdetail = {
       if (tag.label == '收款结算') {
         state.receiptSettle = true;
       }
+      if (tag.label == '主营项目') {
+        state.mainItemStatus = true;
+      }
     }
   }
 

+ 0 - 1
src/views/purchase/contract/index.vue

@@ -290,7 +290,6 @@ export default {
     expandChange(row, expendList) {
       if(row){
         getItemByPid(row.id).then(res =>{
-          console.log(res.data.data)
           this.$set(this.dataList[row.$index],"insideList", res.data.data)
           row.loading = false
         })

+ 1 - 1
src/views/purchase/stockBill/index.vue

@@ -86,7 +86,7 @@
         console.log('1')
       },
       refreshChange() {
-        console.log('1')
+        this.onLoad(this.page);
       },
       onLoad(page, params = {}) {
         this.loading = true;

+ 6 - 24
src/views/workManagement/main-items/configuration/detailsPage.json

@@ -72,22 +72,14 @@
       ]
     },
     {
-      "label": "单价",
-      "prop": "price",
-      "width": 120,
-      "cell": true
-    },
-    {
-      "label": "计价单位",
-      "prop": "unit",
-      "width": 120,
-      "cell": true
+      "label": "服务费",
+      "prop": "serviceCharge",
+      "width": 120
     },
     {
-      "label": "数量",
-      "prop": "quantity",
-      "width": 120,
-      "cell": true
+      "label": "代垫费",
+      "prop": "matMoney",
+      "width": 120
     },
     {
       "label": "合计金额",
@@ -102,16 +94,6 @@
       ]
     },
     {
-      "label": "服务费",
-      "prop": "serviceCharge",
-      "width": 120
-    },
-    {
-      "label": "代垫费",
-      "prop": "matMoney",
-      "width": 120
-    },
-    {
       "label": "频率",
       "prop": "frequency",
       "type": "select",

+ 7 - 13
src/views/workManagement/main-items/configuration/mainList.json

@@ -8,7 +8,10 @@
   "tip": false,
   "searchShow": true,
   "searchMenuPosition": "right",
-  "searchMenuSpan": 12,
+  "searchMenuSpan": 16,
+  "searchSpan": 8,
+  "searchIcon": true,
+  "searchIndex": 2,
   "tree": true,
   "selection": false,
   "editBtn": false,
@@ -18,12 +21,10 @@
   "menuWidth": 220,
   "column": [
     {
-      "label": "项目编码",
-      "prop": "code",
+      "label": "客户名称",
+      "prop": "corpId",
       "search": true,
-      "index": 2,
-      "width": 120,
-      "overHidden": true
+      "hide": true
     },
     {
       "label": "项目名称",
@@ -41,13 +42,6 @@
       "overHidden": true
     },
     {
-      "label": "客户名称",
-      "prop": "corpId",
-      "searchSpan": 12,
-      "search": true,
-      "hide": true
-    },
-    {
       "label": "应收金额",
       "prop": "debitAmount",
       "index": 5,

+ 65 - 54
src/views/workManagement/main-items/detailsPage.vue

@@ -99,9 +99,16 @@
             >删除</el-button>
           </template>
           <template slot="userid" slot-scope="{row,index}">
-            <span v-if="row.$cellEdit" style="float: left;color: #F56C6C;">*</span>
-            <span style="margin-left: 12px;padding-top: 2px">{{ row.userName }}</span>
-            <el-button v-if="row.$cellEdit" type="text" size="mini" style="float: right" @click="selectUser(row)">选择</el-button>
+            <span v-if="row.$cellEdit" class="required_fields">*</span>
+            <user-select
+              style="width:90% !important;"
+              v-if="row.$cellEdit"
+              v-model="row.userName"
+              @value="(values) => value(values,row)"
+              :configuration="UConfiguration"
+            >
+            </user-select>
+            <span v-else>{{ row.userName }}</span>
           </template>
           <template slot="amount" slot-scope="{ row }">
             <el-input
@@ -121,6 +128,7 @@
               placeholder="请输入"
               size="small"
               oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
+              @input="costCount(row)"
               @change="totalChange(row,'服务')"
             ></el-input>
             <span v-else>{{ row.serviceCharge }}</span>
@@ -132,6 +140,7 @@
               placeholder="请输入"
               size="small"
               oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
+              @input="costCount(row)"
               @change="totalChange(row,'代垫')"
             ></el-input>
             <span v-else>{{ row.matMoney }}</span>
@@ -278,6 +287,11 @@
 
 
   export default {
+    props: {
+      detailData: {
+        type: Object
+      }
+    },
     data() {
       return {
         id:'',
@@ -299,6 +313,15 @@
           placeholder:'请点击右边按钮选择',
           dicData:[]
         },
+        UConfiguration:{
+          multipleChoices:false,
+          multiple:false,
+          disabled:false,
+          searchShow:true,
+          collapseTags:false,
+          placeholder:'请点击右边按钮选择',
+          dicData:[]
+        },
         page: {
           currentPage: 1,
           total: 0,
@@ -310,29 +333,9 @@
         basicData: {
           column: [
             {
-              label: '系统编号',
-              prop: 'sysNo',
-              disabled: true,
-              rules: [
-                {
-                  required: false,
-                  message: ' ',
-                  trigger: 'blur'
-                }
-              ]
-            }, {
-              label: '项目编码',
-              prop: 'code',
-              rules: [
-                {
-                  required: true,
-                  message: ' ',
-                  trigger: 'blur'
-                }
-              ]
-            }, {
               label: '项目名称',
               prop: 'cname',
+              span: 12,
               rules: [
                 {
                   required: true,
@@ -340,9 +343,11 @@
                   trigger: 'blur'
                 }
               ]
-            }, {
+            },
+            {
               label: '客户名称',
               prop: 'corpId',
+              span: 12,
             },{
               label: '合同金额',
               prop: 'debitAmount',
@@ -579,21 +584,21 @@
     },
     created() {
       // 表格行编辑 输入框change事件
-      //单价
-      this.optionTable.column[5].change = function (val) {
-        val.row.amount = val.row.quantity*val.value;
-      }
-      //数量
-      this.optionTable.column[7].change = function (val) {
-        val.row.amount = val.row.price*val.value;
-      }
+      // //单价
+      // this.optionTable.column[5].change = function (val) {
+      //   val.row.amount = val.row.quantity*val.value;
+      // }
+      // //数量
+      // 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)
       this.$set(this.form,"balanceAmount",0)
-      if(this.$route.query.id){
-        this.id = BigInt(this.$route.query.id);//字符串转数字  超长用BigInt
+      if(this.detailData.id){
+        this.id = BigInt(this.detailData.id);//字符串转数字  超长用BigInt
         this.getProjectDetail();
       }
       if(this.$route.query.itemId){
@@ -616,18 +621,28 @@
 
     },
     methods: {
+      value(value,row){
+        row.userid = value.id
+        row.deptid = value.deptId
+        // this.$set(row,"userid",value.id)
+        // this.$set(row,"deptid",value.deptId)
+        console.log(row)
+      },
       //合计
       totalChange(row,type){
+        //明细列表金额合计
         let amountList =  this.data.map(item => {
           if(item.amount){
             return parseFloat(item.amount);
           }else return 0
         });
+        //明细列表服务费合计
         let serviceChargeList =  this.data.map(item => {
           if(item.serviceCharge){
             return parseFloat(item.serviceCharge);
           }else return 0
         });
+        //明细列表代垫费合计
         let matMoneyList =  this.data.map(item => {
           if(item.matMoney){
             return parseFloat(item.matMoney);
@@ -654,6 +669,12 @@
           }
         }
       },
+      //费用计算计算
+      costCount(row){
+        if(row.serviceCharge && row.matMoney){
+           row.amount = _.add(parseFloat(row.serviceCharge),parseFloat(row.matMoney));
+        }
+      },
       //查询明细
       getProjectDetail(pleaseCheck){
         if(this.id){
@@ -841,7 +862,7 @@
                   type: "success",
                   message: "操作成功!"
                 });
-               this.goBackPage();
+               this.$emit("goBack");
               }else{
                 this.$message({
                   type: "success",
@@ -873,32 +894,17 @@
         if(contrastObj(this.form,this.oldForm) || contrastList(this.data,this.oldData)
           || contrastList(this.upLoadData,this.oldUpLoadData)
         ){
-          this.$confirm("是否保存当前页面?", "提示", {
+          this.$confirm("当前页面有未保存数据,是否保存数据?", "提示", {
             confirmButtonText: "保存",
             cancelButtonText: "取消",
             type: "warning",
           }).then(() => {
             this.editMainProject(10001)
           }).catch(()=>{
-            this.goBackPage();
+            this.$emit("goBack");
           })
         }else{
-         this.goBackPage();
-        }
-      },
-      //返回列表判断返回那一个
-      goBackPage(){
-        if(this.$route.query.itemId){   //如果是从统计列表跳转过来的  那么在调回去
-          this.$router.push({
-            path: '/statistical_List',
-            query: {}
-          });
-        }else{
-          this.$router.$avueRouter.closeTag();
-          this.$router.push({
-            path: '/workManagement/main-items/list',
-            query: {}
-          });
+          this.$emit("goBack");
         }
       },
       //点击修改或保存时触发
@@ -1081,6 +1087,11 @@
     color: #323233;
     font-weight: 400;
   }
+  .required_fields{
+    color: #F56C6C;
+    display:inline-block;
+    width: 7%
+  }
   .avue-tree {
     overflow: hidden;
     max-height: 660px;

+ 36 - 15
src/views/workManagement/main-items/list.vue

@@ -1,5 +1,5 @@
 <template>
-  <basic-container>
+  <basic-container v-if="show">
     <avue-crud
       ref="crud"
       :data="data"
@@ -22,11 +22,11 @@
           :configuration="configuration"
         ></select-component>
       </template>
-      <template slot="menuLeft">
+      <template slot="menuLeft" scope="{ row,index }">
         <el-button type="primary"
                    size="small"
                    icon="el-icon-plus"
-                   @click="addMainItems">新 单
+                   @click="addMainItems(row)">新 单
         </el-button>
         <el-button size="small"
                    type="info"
@@ -57,10 +57,17 @@
       ></report-dialog>
     </avue-crud>
   </basic-container>
+  <detail-page
+    ref="detail"
+    @goBack="goBack"
+    :detailData="detailData"
+    v-else
+  ></detail-page>
 </template>
 
 <script>
   import option from "./configuration/mainList.json";
+  import detailPage from "./detailsPage.vue";
   import { getList,deleteMain } from "@/api/workManagement/mainProject";
   import reportDialog from "@/components/report-dialog/main";
   import { micrometerFormat } from "@/util/validate";
@@ -72,6 +79,8 @@ export default {
       switchDialog:false,
       loading: false,
       data: [],
+      show: true,
+      detailData:{},
       search:{},
       configuration:{
         multipleChoices:false,
@@ -92,13 +101,20 @@ export default {
     };
   },
   created() {
-    // option.height = window.innerHeight - 380 ;
+    if(this.$route.query.itemId){
+      this.detailData={
+        itemId:this.$route.query.itemId
+      }
+      this.show = false;
+      this.$store.commit("MAIN_IN_DETAIL");
+    }
   },
   mounted() {
 
   },
   components: {
-    reportDialog
+    reportDialog,
+    detailPage
   },
   methods: {
     //打印
@@ -128,18 +144,19 @@ export default {
     },
     //新单打开
     addMainItems(){
-      this.$router.push({
-        path: "/mainItems_detailsPage",
-        query: {id: ''},
-      });
+      this.detailData = {
+        id: '',
+      };
+      this.show = false;
+      this.$store.commit("MAIN_IN_DETAIL");
     },
     //编辑打开
     editOpen(row, index){
-      console.log(row)
-      this.$router.push({
-        path: "/mainItems_detailsPage",
-        query: {id:row.id},
-      });
+      this.detailData = {
+        id: row.id
+      };
+      this.show = false;
+      this.$store.commit("MAIN_IN_DETAIL");
     },
     searchChange(params, done) {
       this.getList(this.page, params);
@@ -223,7 +240,11 @@ export default {
         path: "/mainItems_detailsPage",
         query: { id: JSON.stringify(row.prop1) }
       });
-    }
+    },
+    goBack() {
+      this.detailData=this.$options.data().detailData
+      this.show = true;
+    },
   }
 };
 </script>

+ 4 - 9
src/views/workManagement/receipt/configuration/settleAccounts.json

@@ -8,7 +8,10 @@
   "tip": false,
   "searchShow": true,
   "searchMenuPosition": "right",
-  "searchMenuSpan": 18,
+  "searchMenuSpan": 16,
+  "searchSpan": 8,
+  "searchIcon": true,
+  "searchIndex": 2,
   "tree": true,
   "selection": false,
   "editBtn": false,
@@ -37,14 +40,6 @@
   ],
   "column": [
     {
-      "label": "项目编码",
-      "prop": "code",
-      "search": true,
-      "overHidden": true,
-      "index": 2,
-      "width": 120
-    },
-    {
       "label": "项目名称",
       "prop": "cname",
       "search": true,

+ 31 - 49
src/views/workManagement/receipt/configuration/settleAccountsDetailsPage.json

@@ -43,10 +43,35 @@
       "width": 120
     },
     {
-      "label": "收费建议",
-      "prop": "remarks",
+      "label": "服务费",
+      "prop": "serviceCharge",
+      "width": 120
+    },
+    {
+      "label": "代垫费",
+      "prop": "matMoney",
+      "width": 120
+    },
+    {
+      "label": "合计金额",
+      "prop": "amount",
       "overHidden": true,
-      "width": 150
+      "width": 120
+    },
+    {
+      "label": "账户名称",
+      "prop": "accountName",
+      "overHidden": true,
+      "width": 120
+    },
+    {
+      "label": "结算日期",
+      "prop": "payTime",
+      "width": 120,
+      "overHidden": true,
+      "valueFormat": "yyyy-MM-dd",
+      "format": "yyyy-MM-dd",
+      "type": "date"
     },
     {
       "label": "承做人",
@@ -76,53 +101,10 @@
       ]
     },
     {
-      "label": "账户名称",
-      "prop": "accountName",
-      "overHidden": true,
-      "width": 120
-    },
-    {
-      "label": "结算日期",
-      "prop": "payTime",
-      "width": 120,
-      "overHidden": true,
-      "valueFormat": "yyyy-MM-dd",
-      "format": "yyyy-MM-dd",
-      "type": "date"
-    },
-    {
-      "label": "单价",
-      "prop": "price",
-      "overHidden": true,
-      "width": 120
-    },
-    {
-      "label": "计价单位",
-      "prop": "unit",
-      "overHidden": true,
-      "width": 120
-    },
-    {
-      "label": "数量",
-      "prop": "quantity",
-      "overHidden": true,
-      "width": 120
-    },
-    {
-      "label": "合计金额",
-      "prop": "amount",
+      "label": "收费建议",
+      "prop": "remarks",
       "overHidden": true,
-      "width": 120
-    },
-    {
-      "label": "服务费",
-      "prop": "serviceCharge",
-      "width": 120
-    },
-    {
-      "label": "代垫费",
-      "prop": "matMoney",
-      "width": 120
+      "width": 150
     },
     {
       "label": "频率",

+ 48 - 45
src/views/workManagement/receipt/configuration/statisticalList.json

@@ -9,7 +9,10 @@
   "searchShow": true,
   "searchMenuPosition": "right",
   "tree": true,
-  "searchMenuSpan": 12,
+  "searchMenuSpan": 24,
+  "searchSpan": 8,
+  "searchIcon": true,
+  "searchIndex": 2,
   "selection": false,
   "viewBtn": false,
   "editBtn": false,
@@ -36,14 +39,12 @@
       "label": "客户名称",
       "search": true,
       "hide": true,
-      "searchOrder": 1,
       "prop": "cornId"
     },
     {
       "label": "任务部门",
       "search": true,
       "hide": true,
-      "searchOrder": 3,
       "type":"tree",
       "dicUrl": "/api/blade-system/dept/tree?tenantId=096359",
       "props": {
@@ -53,11 +54,19 @@
       "prop": "deptid"
     },
     {
+      "label": "服务项目",
+      "prop": "pname",
+      "search": true,
+      "index": 3,
+      "overHidden": true,
+      "width": 120
+    },
+    {
       "label": "状态",
       "prop": "status",
       "type": "select",
+      "index": 1,
       "search": true,
-      "searchOrder": 6,
       "overHidden": true,
       "dicData": [
         {
@@ -92,78 +101,58 @@
     },
     {
       "label": "客户名称",
-      "searchOrder": 1,
       "prop": "cornName",
       "overHidden": true,
+      "index": 2,
       "width": 150
     },
     {
-      "label": "服务项目",
-      "prop": "pname",
-      "searchOrder": 5,
-      "search": true,
-      "overHidden": true,
-      "width": 120
-    },
-    {
-      "label": "承做人",
-      "prop": "userName",
-      "search": true,
-      "searchOrder": 2,
-      "overHidden": true,
-      "width": 120
-    },
-    {
-      "label": "任务部门",
-      "prop": "deptName",
-      "overHidden": true,
-      "width": 120
-    },
-    {
-      "label": "单价",
-      "prop": "price",
+      "label": "毛收入",
+      "prop": "grossIncome",
+      "index": 4,
       "overHidden": true,
       "width": 120
     },
     {
-      "label": "计价单位",
-      "prop": "unit",
+      "label": "服务费",
+      "prop": "serviceCharge",
+      "index": 5,
       "overHidden": true,
       "width": 120
     },
     {
-      "label": "数量",
-      "prop": "quantity",
+      "label": "代垫费",
+      "prop": "matMoney",
+      "index": 6,
       "overHidden": true,
       "width": 120
     },
     {
       "label": "合计金额",
       "prop": "amount",
+      "index": 7,
       "overHidden": true,
       "width": 120
     },
     {
-      "label": "服务费",
-      "prop": "serviceCharge",
+      "label": "承做人",
+      "prop": "userName",
+      "index": 8,
+      "search": true,
       "overHidden": true,
       "width": 120
     },
     {
-      "label": "代垫费",
-      "prop": "matMoney",
+      "label": "任务部门",
+      "prop": "deptName",
+      "index": 9,
       "overHidden": true,
       "width": 120
     },
     {
-      "label": "备注",
-      "prop": "remarks",
-      "overHidden": true,
-      "width": 180
-    },
-    {
       "label": "账户名称",
       "prop": "accountName",
+      "index": 10,
       "overHidden": true,
       "width": 120
     },
@@ -171,25 +160,26 @@
       "label": "结算日期",
       "prop": "payTime",
       "type": "date",
+      "index": 11,
       "unlinkPanels": true,
       "searchRange": true,
       "search": true,
-      "searchOrder": 4,
       "format": "yyyy-MM-dd",
       "valueFormat": "yyyy-MM-dd",
       "overHidden": true,
       "width":150
     },
-
     {
       "label": "频率",
       "prop": "frequency",
+      "index": 12,
       "overHidden": true,
       "width": 120
     },
     {
       "label": "提醒日",
       "prop": "reminderDay",
+      "index": 13,
       "valueFormat": "yyyy-MM-dd HH:mm:ss",
       "format": "yyyy-MM-dd",
       "overHidden": true,
@@ -199,6 +189,7 @@
     {
       "label": "需求开始日期",
       "prop": "beginTime",
+      "index": 14,
       "valueFormat": "yyyy-MM-dd HH:mm:ss",
       "format": "yyyy-MM-dd",
       "overHidden": true,
@@ -208,6 +199,7 @@
     {
       "label": "需求完成日期",
       "prop": "actualDate",
+      "index": 15,
       "valueFormat": "yyyy-MM-dd HH:mm:ss",
       "format": "yyyy-MM-dd",
       "overHidden": true,
@@ -217,6 +209,7 @@
     {
       "label": "制单人",
       "prop": "createUserName",
+      "index": 16,
       "overHidden": true,
       "width": 120
     },
@@ -224,11 +217,13 @@
       "label": "制单日期",
       "prop": "createTime",
       "type": "date",
+      "index": 17,
       "overHidden": true,
       "width": 150
     },
     {
       "label": "最新修改人",
+      "index": 18,
       "prop": "updateUserName",
       "overHidden": true,
       "width": 120
@@ -236,8 +231,16 @@
     {
       "label": "最新修改时间",
       "prop": "updateTime",
+      "index": 19,
       "overHidden": true,
       "width": 150
+    },
+    {
+      "label": "备注",
+      "prop": "remarks",
+      "index": 20,
+      "overHidden": true,
+      "width": 180
     }
   ]
 }

+ 21 - 5
src/views/workManagement/receipt/settleAccounts.vue

@@ -1,5 +1,5 @@
 <template>
-  <basic-container>
+  <basic-container  v-if="show">
     <avue-crud
       ref="crud"
       :data="data"
@@ -41,16 +41,25 @@
       </template>
     </avue-crud>
   </basic-container>
+  <detail-page
+    ref="detail"
+    @goBack="goBack"
+    :detailData="detailData"
+    v-else
+  ></detail-page>
 </template>
 
 <script>
   import option from "./configuration/settleAccounts.json";
   import { getList } from "@/api/workManagement/mainProject";
+  import detailPage from "./settleAccountsDetailsPage.vue";
 
   export default {
     data() {
       return {
         loading: false,
+        show:true,
+        detailData:{},
         data: [],
         option: option,
         search:{},
@@ -71,6 +80,9 @@
         }
       };
     },
+    components:{
+      detailPage
+    },
     mounted() {
       // option.height = window.innerHeight - 340 ;
     },
@@ -93,10 +105,10 @@
       },
       //结算
       settleAccounts(row){
-        this.$router.push({
-          path: "/settleAccounts_detailsPage",
-          query: {id: row.id},
-        });
+        this.detailData = {
+          id: row.id
+        };
+        this.show = false;
       },
       searchChange(params, done) {
         this.getList(this.page, params);
@@ -132,6 +144,10 @@
       saveColumn(row, column) {
         console.log(row, column);
       },
+      goBack() {
+        this.detailData=this.$options.data().detailData
+        this.show = true;
+      },
     }
   };
 </script>

+ 46 - 30
src/views/workManagement/receipt/settleAccountsDetailsPage.vue

@@ -56,6 +56,22 @@
               @click.stop="openReport()"
             >报表
             </el-button>
+            <el-button
+              icon="el-icon-printer"
+              size="small"
+              type="primary"
+              :disabled="selectList.length == 0"
+              @click.stop="costAdd()"
+            >追加代垫费
+            </el-button>
+            <el-button
+              icon="el-icon-printer"
+              size="small"
+              type="primary"
+              :disabled="selectList.length == 0"
+              @click.stop="costReturn()"
+            >退费
+            </el-button>
           </template>
           <template slot-scope="scope" slot="menu">
             <el-button
@@ -127,6 +143,11 @@
 
   export default {
     name: "customerInformation",
+    props: {
+      detailData: {
+        type: Object
+      }
+    },
     data() {
       return {
         loading:false,
@@ -145,6 +166,7 @@
         parentId:0,
         account:{},
         paymentTerm:[],
+        selectList:[],
         page: {
           pageSize: 10,
           pagerCount: 5,
@@ -164,30 +186,9 @@
         basicData: {
           column: [
             {
-              label: '系统编号',
-              prop: 'sysNo',
-              disabled: true,
-              rules: [
-                {
-                  required: true,
-                  message: ' ',
-                  trigger: 'blur'
-                }
-              ]
-            }, {
-              label: '项目编码',
-              prop: 'code',
-              disabled: true,
-              rules: [
-                {
-                  required: true,
-                  message: ' ',
-                  trigger: 'blur'
-                }
-              ]
-            }, {
               label: '项目名称',
               prop: 'cname',
+              span:12,
               disabled: true,
               rules: [
                 {
@@ -198,6 +199,7 @@
               ]
             }, {
               label: '客户名称',
+              span:12,
               prop: 'corpId',
               disabled: true,
             },{
@@ -328,6 +330,14 @@
               type:'datetime',
             },
             {
+              label: '追加代垫费',
+              prop: 'superaddition',
+            },
+            {
+              label: '退费',
+              prop: 'costReturn',
+            },
+            {
               label: '备注',
               span: 24,
               prop: 'remark',
@@ -350,7 +360,7 @@
       }
     },
     created() {
-      this.id = BigInt(this.$route.query.id);
+      this.id = BigInt(this.detailData.id);
       this.getProjectDetail();
       const params = {
         code : "affair_payment_term"
@@ -363,6 +373,16 @@
 
     },
     methods: {
+      //追加代垫费
+      costAdd(){
+        this.selectList.forEach(item =>{
+
+        })
+      },
+      //退费
+      costReturn(){
+
+      },
       getProjectDetail(){
         if(this.id){
           projectDetail(this.id,"4,5").then(res =>{
@@ -429,11 +449,7 @@
       },
       //返回列表
       backToList(){
-        this.$router.$avueRouter.closeTag();
-        this.$router.push({
-          path: '/workManagement/receipt/settleAccounts',
-          query: {}
-        });
+        this.$emit("goBack");
       },
       //新增 修改
       editMainProject(){
@@ -455,8 +471,8 @@
       searchReset() {
         console.log('1')
       },
-      selectionChange() {
-        console.log('1')
+      selectionChange(row) {
+        this.selectList = row
       },
       currentChange() {
         console.log('1')

+ 15 - 4
src/views/workManagement/receipt/statisticalList.vue

@@ -92,10 +92,21 @@
 
       },
       check(row,index){
-        this.$router.push({
-          path: "/mainItems_detailsPage",
-          query: { itemId: row.id }
-        });
+        if(this.$store.getters.mainItemStatus){
+          this.$alert("主营项目页面已存在,请关闭主营项目再进行操作", "温馨提示", {
+            confirmButtonText: "确定",
+            type: 'warning',
+            callback: action => {
+            }
+          });
+        }else{
+          //关闭一下存在的列表页
+          this.$router.$avueRouter.closeTag('/workManagement/main-items/list');
+          this.$router.push({
+            path: "/workManagement/main-items/list",
+            query: {itemId: row.id},
+          });
+        }
       },
       //点击搜索按钮触发
       searchChange(params, done) {

+ 16 - 14
src/views/workManagement/task/configuration/mainList.json

@@ -7,7 +7,10 @@
   "tip": false,
   "searchShow": true,
   "searchMenuPosition": "right",
-  "searchMenuSpan": 6,
+  "searchSpan": 8,
+  "searchIcon": true,
+  "searchIndex": 2,
+  "searchMenuSpan": 24,
   "tree": true,
   "selection": false,
   "addBtn": false,
@@ -22,6 +25,14 @@
     {
       "name": "amount",
       "type": "sum"
+    },
+    {
+      "name": "serviceCharge",
+      "type": "sum"
+    },
+    {
+      "name": "matMoney",
+      "type": "sum"
     }
   ],
   "column": [
@@ -81,21 +92,13 @@
       "width": 120
     },
     {
-      "label": "单价",
-      "prop": "price",
-      "overHidden": true,
-      "width": 120
-    },
-    {
-      "label": "计价单位",
-      "prop": "unit",
-      "overHidden": true,
+      "label": "服务费",
+      "prop": "serviceCharge",
       "width": 120
     },
     {
-      "label": "数量",
-      "prop": "quantity",
-      "overHidden": true,
+      "label": "代垫费",
+      "prop": "matMoney",
       "width": 120
     },
     {
@@ -128,7 +131,6 @@
       "searchRange": true,
       "search": true,
       "overHidden": true,
-      "searchOrder": 3,
       "width": 150,
       "cell": true
     },