Sfoglia il codice sorgente

Merge branch 'dev' of http://git.echepei.com/caojunjie/Smart_platform_ui into dev

QuKatie 3 anni fa
parent
commit
03cb19d906
27 ha cambiato i file con 1117 aggiunte e 860 eliminazioni
  1. 29 0
      src/api/financialManagement/invoice.js
  2. 3 2
      src/components/bill/billApplication.vue
  3. 4 1
      src/components/bill/billDetailList.vue
  4. 2 1
      src/components/bill/config/application.json
  5. 7 0
      src/components/bill/config/mainList.json
  6. 149 104
      src/components/finance/financialAccount.vue
  7. 6 0
      src/page/index/tags.vue
  8. 2 0
      src/store/getters.js
  9. 22 0
      src/store/modules/ifdetail.js
  10. 2 1
      src/views/businessManagement/deliveryNotice/detailsPageEdit.vue
  11. 12 5
      src/views/financialManagement/billDetails/configuration/mainList.json
  12. 3 9
      src/views/financialManagement/incomeInvoice/configuration/detailsPage.json
  13. 45 30
      src/views/financialManagement/incomeInvoice/configuration/invoicepage.json
  14. 24 81
      src/views/financialManagement/incomeInvoice/configuration/mainList.json
  15. 7 12
      src/views/financialManagement/incomeInvoice/incomeInvoice.vue
  16. 294 239
      src/views/financialManagement/incomeInvoice/incomeInvoiceDetailsPage.vue
  17. 3 3
      src/views/financialManagement/outputInvoice/configuration/detailsPage.json
  18. 45 30
      src/views/financialManagement/outputInvoice/configuration/invoicepage.json
  19. 24 81
      src/views/financialManagement/outputInvoice/configuration/mainList.json
  20. 2 1
      src/views/financialManagement/outputInvoice/outputInvoice.vue
  21. 295 228
      src/views/financialManagement/outputInvoice/outputInvoiceDetailsPage.vue
  22. 1 0
      src/views/financialManagement/paymentSettle/paymentSettleDetailsPage.vue
  23. 1 0
      src/views/financialManagement/receiptSettle/receiptSettleDetailsPage.vue
  24. 53 14
      src/views/purchase/contract/detailsPage.vue
  25. 51 12
      src/views/salesManagement/salesContract/detailsPage.vue
  26. 3 0
      src/views/workManagement/main-items/configuration/mainList.json
  27. 28 6
      src/views/workManagement/main-items/detailsPage.vue

+ 29 - 0
src/api/financialManagement/invoice.js

@@ -0,0 +1,29 @@
+import request from '@/router/axios';
+
+//生成开票
+export const createInvoiceItem = (data) => {
+  return request({
+    url: '/api/blade-client/settlement/createInvoiceItem',
+    method: 'get',
+    data: data
+  })
+}
+
+//确认开票
+export const putFund = (data) => {
+  return request({
+    url: '/api/trade-finance/settlement/putFund',
+    method: 'post',
+    data: data
+  })
+}
+
+//取消开票
+export const cancelFund = (data) => {
+  return request({
+    url: '/api/trade-finance/settlement/cancelFund',
+    method: 'post',
+    data: data
+  })
+}
+

+ 3 - 2
src/components/bill/billApplication.vue

@@ -88,10 +88,11 @@
       }
     },
     created() {
-
+      //在账单处关闭了搜索条件  在此处要打开
+      this.historyOption.searchShow = true
     },
     mounted() {
-      option.height = window.innerHeight - 200 ;
+
     },
     methods: {
       //新单打开

+ 4 - 1
src/components/bill/billDetailList.vue

@@ -37,6 +37,9 @@
       billType:{
         type: String
       },
+      flag:{
+        type: Number
+      },
       params:{
         type: Object
       },
@@ -98,7 +101,7 @@
           ...this.params
         }
         params.billType = this.billType
-        params.flag = 1
+        params.flag = this.flag
         getBillList(page.currentPage, page.pageSize,params).then(res=>{
           this.data = res.data.data.records
           this.page.total = res.data.data.total

+ 2 - 1
src/components/bill/config/application.json

@@ -9,6 +9,7 @@
   "cellBtn":false,
   "cancelBtn":false,
   "refreshBtn": false,
+  "searchBtn": false,
   "searchMenuPosition": "right",
   "searchMenuSpan": 24,
   "searchSpan": 8,
@@ -18,7 +19,7 @@
   "tree": true,
   "border": true,
   "index": true,
-  "selection": true,
+  "selection": false,
   "menu": false,
   "menuWidth": 0,
   "searchIcon": true,

+ 7 - 0
src/components/bill/config/mainList.json

@@ -79,6 +79,13 @@
       "index": 8
     },
     {
+      "label": "开票金额",
+      "prop": "invoiceAmount",
+      "width": 150,
+      "overHidden": true,
+      "index": 8
+    },
+    {
       "label": "备注",
       "prop": "remark",
       "overHidden": true,

+ 149 - 104
src/components/finance/financialAccount.vue

@@ -1,119 +1,137 @@
 <template>
   <div>
-    <avue-crud
-      ref="crud"
-      :data="data"
-      :option="option"
-      :table-loading="loading"
-      @row-update="rowUpdate"
-      @row-del="rowDel"
-      @saveColumn="saveColumn"
-      @resetColumn="resetColumn"
-    >
-      <template slot="menuLeft" slot-scope="{size}">
-        <el-button type="primary"
-                   icon="el-icon-plus"
-                   size="small"
-                   :loading="submitButton"
-                   @click="entering"
-        >录入
-        </el-button>
-      </template>
-      <template slot-scope="{row,index}" slot="menu">
-<!--        <el-button-->
-<!--          type="text"-->
-<!--          size="small"-->
-<!--          icon="el-icon-edit"-->
-<!--          @click="rowCell(row,index)"-->
-<!--        >{{ row.$cellEdit ? '修改完成' : '修改' }}-->
-<!--        </el-button>-->
-        <el-button
-          type="text"
-          icon="el-icon-delete"
-          size="small"
-          @click="rowDel(row,index)"
-        >删除
-        </el-button>
-      </template>
-      <template slot-scope="{row,index}" slot="corpId">
-        <span v-if="row.$cellEdit" class="required_fields" style="float: left;line-height: 32px">*</span>
-        <crop-select
-          v-if="row.$cellEdit"
-          v-model="corpId"
-          corpType="KG"
-          style="width: 100%"
-        ></crop-select>
-      </template>
-      <template slot-scope="{row,index}" slot="costType">
-        <span v-if="row.$cellEdit" class="required_fields">*</span>
-        <breakdown-select
-          v-if="row.$cellEdit"
-          v-model="row.costType"
-          style="width: 90%"
-          :configuration="configuration">
-        </breakdown-select>
-        <span v-else>{{ row.costType }}</span>
-      </template>
-      <template slot-scope="{row,index}" slot="billNo">
-        <el-select placeholder="请选择"
-                   v-if="row.$cellEdit"
-                   v-model="row.billNo"
-                   size="small"
-                   filterable
-                   allow-create
-                   default-first-option
-                   clearable>
-          <el-option
-            v-for="item in row.billNoList"
-            :key="item"
-            :label="item"
-            :value="item"
-          ></el-option>
-        </el-select>
-        <span v-else>{{ row.billNo }}</span>
-      </template>
-      <template slot-scope="{row,index}" slot="taxRate">
-        <el-input
-          v-model="row.taxRate"
-          v-if="row.$cellEdit"
-          size="small"
-          oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d\d\d\d\d).*$/, "$1.$2")'
-          autocomplete="off"
-        >
-          <i slot="suffix" style="margin-right: 10px;top:6px">%</i>
-        </el-input>
-        <span v-else>{{ row.taxRate }}</span>
-      </template>
-      <template slot-scope="{row,index}" slot="currency">
-        <span v-if="row.$cellEdit" class="required_fields">*</span>
-        <el-select v-if="row.$cellEdit" v-model="row.currency" size="small" placeholder="请选择" style="width: 90%" @change="currencyChange(row)" clearable filterable>
-          <el-option v-for="(item,index) in currencyDic" :key="index" :label="item.dictValue"  :value="item.dictValue"></el-option>
-        </el-select>
-        <span v-else>{{ row.currency }}</span>
-      </template>
-      <template slot-scope="{row,index}" slot="unit">
-        <span v-if="row.$cellEdit" class="required_fields">*</span>
-        <el-select  v-if="row.$cellEdit" v-model="row.unit" size="small" style="width: 90%" placeholder="请选择" clearable filterable>
-          <el-option v-for="(item,index) in unitDic" :key="index" :label="item.dictValue"  :value="item.dictValue"></el-option>
-        </el-select>
-        <span v-else>{{ row.unit }}</span>
-      </template>
-    </avue-crud>
-    <div class="dialogButton">
-      <el-button size="small" :loading="submitButton" @click="$emit('choceFun')">取消</el-button>
-      <el-button type="primary" size="small" :loading="submitButton" @click="submit()">确定</el-button>
-    </div>
+    <basic-container>
+      <avue-crud
+        ref="crud"
+        :data="data"
+        :option="option"
+        :table-loading="loading"
+        @row-update="rowUpdate"
+        @row-del="rowDel"
+        @saveColumn="saveColumn"
+        @resetColumn="resetColumn"
+      >
+        <template slot="menuLeft" slot-scope="{size}">
+          <el-button type="primary"
+                     icon="el-icon-plus"
+                     size="small"
+                     :loading="submitButton"
+                     @click="entering"
+          >录入
+          </el-button>
+        </template>
+        <template slot-scope="{row,index}" slot="menu">
+          <!--        <el-button-->
+          <!--          type="text"-->
+          <!--          size="small"-->
+          <!--          icon="el-icon-edit"-->
+          <!--          @click="rowCell(row,index)"-->
+          <!--        >{{ row.$cellEdit ? '修改完成' : '修改' }}-->
+          <!--        </el-button>-->
+          <el-button
+            type="text"
+            icon="el-icon-delete"
+            size="small"
+            @click="rowDel(row,index)"
+          >删除
+          </el-button>
+        </template>
+        <template slot-scope="{row,index}" slot="corpId">
+          <span v-if="row.$cellEdit" class="required_fields" style="float: left;line-height: 32px">*</span>
+          <crop-select
+            v-if="row.$cellEdit"
+            v-model="corpId"
+            corpType="KG"
+            style="width: 100%"
+          ></crop-select>
+        </template>
+        <template slot-scope="{row,index}" slot="costType">
+          <span v-if="row.$cellEdit" class="required_fields">*</span>
+          <breakdown-select
+            v-if="row.$cellEdit"
+            v-model="row.costType"
+            style="width: 90%"
+            :configuration="configuration">
+          </breakdown-select>
+          <span v-else>{{ row.costType }}</span>
+        </template>
+        <template slot-scope="{row,index}" slot="billNo">
+          <el-select placeholder="请选择"
+                     v-if="row.$cellEdit"
+                     v-model="row.billNo"
+                     size="small"
+                     filterable
+                     allow-create
+                     default-first-option
+                     clearable>
+            <el-option
+              v-for="item in row.billNoList"
+              :key="item"
+              :label="item"
+              :value="item"
+            ></el-option>
+          </el-select>
+          <span v-else>{{ row.billNo }}</span>
+        </template>
+        <template slot-scope="{row,index}" slot="taxRate">
+          <el-input
+            v-model="row.taxRate"
+            v-if="row.$cellEdit"
+            size="small"
+            oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d\d\d\d\d).*$/, "$1.$2")'
+            autocomplete="off"
+          >
+            <i slot="suffix" style="margin-right: 10px;top:6px">%</i>
+          </el-input>
+          <span v-else>{{ row.taxRate }}</span>
+        </template>
+        <template slot-scope="{row,index}" slot="currency">
+          <span v-if="row.$cellEdit" class="required_fields">*</span>
+          <el-select v-if="row.$cellEdit" v-model="row.currency" size="small" placeholder="请选择" style="width: 90%" @change="currencyChange(row)" clearable filterable>
+            <el-option v-for="(item,index) in currencyDic" :key="index" :label="item.dictValue"  :value="item.dictValue"></el-option>
+          </el-select>
+          <span v-else>{{ row.currency }}</span>
+        </template>
+        <template slot-scope="{row,index}" slot="unit">
+          <span v-if="row.$cellEdit" class="required_fields">*</span>
+          <el-select  v-if="row.$cellEdit" v-model="row.unit" size="small" style="width: 90%" placeholder="请选择" clearable filterable>
+            <el-option v-for="(item,index) in unitDic" :key="index" :label="item.dictValue"  :value="item.dictValue"></el-option>
+          </el-select>
+          <span v-else>{{ row.unit }}</span>
+        </template>
+      </avue-crud>
+      <div class="dialogButton">
+        <el-button size="small" :loading="submitButton" @click="$emit('choceFun')">取消</el-button>
+        <el-button type="primary" size="small" :loading="submitButton" @click="submit()">确定</el-button>
+      </div>
+    </basic-container>
+    <containerTitle title="历史账单"></containerTitle>
+    <basic-container>
+      <avue-crud :option="historyOption"
+                 :data="historyDataList"
+                 ref="historyCrud"
+                 v-model="historyForm"
+                 :page.sync="page"
+                 :table-loading="historyLoading"
+                 @on-load="onLoad">
+      </avue-crud>
+    </basic-container>
   </div>
 </template>
 
 <script>
   import {applyLoan, paymentApply} from "@/api/financialManagement/paymentRequest";
   import option from "./config/option.json"
+  import historyOption from "../bill/config/application.json"
   import {getUserInfo} from "@/api/system/user";
+  import { getBillList } from "@/api/financialManagement/paymentRequest";
 
   export default {
     name: "financialAccount",
     props: {
+      billId:{
+        type:String
+      },
       billType: {
         type: String
       },
@@ -156,9 +174,21 @@
           dicData: []
         },
         category: '',
+
+        historyLoading:false,
+        historyOption:historyOption,
+        historyDataList:[],
+        historyForm:{},
+        page: {
+          pageSize: 10,
+          pagerCount: 1,
+          total: 0,
+        },
       }
     },
     created() {
+      this.historyOption.searchShow = false
+
       getUserInfo().then(res=>{
         this.category = res.data.data.billType
         if (this.category == 2) {
@@ -176,7 +206,11 @@
       this.init()
     },
     watch:{
-
+      billId(val, oldVal) {
+        if(val != oldVal){
+          this.onLoad(this.page)
+        }
+      },
     },
     methods:{
       init(){
@@ -237,6 +271,17 @@
           this.$refs.crud.rowCellAdd(this.billData);
         }
       },
+      onLoad(page,params = {}) {
+        this.historyLoading = true;
+        params.srcParentId = this.billId
+        params.flag = 1
+
+        getBillList(page.currentPage, page.pageSize,params).then(res=>{
+          this.historyDataList = res.data.data.records
+        }).finally(()=>{
+          this.historyLoading = false;
+        })
+      },
       submit(){
         for(let i = 0;i<this.data.length;i++){
           if (this.corpId === (null || "")) {

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

@@ -351,6 +351,12 @@ export default {
         if (tag.label == "采购订单(N)") {
           this.$store.commit("DOMCG_OUT_DETAIL");
         }
+        if (tag.label == "采购订单(I)") {
+          this.$store.commit("ENTRANCE_OUT_DETAIL");
+        }
+        if (tag.label == "销售订单(I)") {
+          this.$store.commit("XSACE_OUT_DETAIL");
+        }
         this.$store.commit("DEL_TAG", tag);
         if (tag.value === this.tag.value) {
           tag = this.tagList[key === 0 ? key : key - 1]; //如果关闭本标签让前推一个

+ 2 - 0
src/store/getters.js

@@ -42,5 +42,7 @@ const getters = {
   domPurStatus: state => state.ifdetail.domPurStatus,
   outputStatus: state => state.ifdetail.outputStatus,
   incomeStatus: state => state.ifdetail.incomeStatus,
+  entranceCgStatus: state => state.ifdetail.entranceCgStatus,
+  entranceXsStatus: state => state.ifdetail.entranceXsStatus,
 }
 export default getters

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

@@ -16,6 +16,8 @@ const ifdetail = {
     domPurStatus: false, // 内贸采购
     outputStatus:false,//销项发票
     incomeStatus:false,//进项发票
+    entranceCgStatus:false,//进口采购
+    entranceXsStatus:false,//进口销售
   },
   actions: {},
   mutations: {
@@ -148,6 +150,20 @@ const ifdetail = {
     INCOME_OUT_DETAIL(state) {
       state.incomeStatus = false;
     },
+    //进口采购
+    ENTRANCE_IN_DETAIL(state) {
+      state.entranceCgStatus = true;
+    },
+    ENTRANCE_OUT_DETAIL(state) {
+      state.entranceCgStatus = false;
+    },
+    //进口采购
+    XSACE_IN_DETAIL(state) {
+      state.entranceXsStatus = true;
+    },
+    XSACE_OUT_DETAIL(state) {
+      state.entranceXsStatus = false;
+    },
     //关闭所有
     DEL_ALL_DETAIL(state) {
       for (let item in state) {
@@ -207,6 +223,12 @@ const ifdetail = {
       if (tag.label == '进项发票') {
         state.incomeStatus = true
       }
+      if (tag.label == '采购订单(I)') {
+        state.entranceCgStatus = true
+      }
+      if (tag.label == '销售订单(I)') {
+        state.entranceXsStatus = true
+      }
     }
   }
 

+ 2 - 1
src/views/businessManagement/deliveryNotice/detailsPageEdit.vue

@@ -1998,8 +1998,9 @@ export default {
       this.checkLock(data).then(res => {
         if (res.data.code == 200) {
           this.onLock(data).then(response => {
+            this.queryData(this.form.id)
+            this.detailData.seeDisabled = false;
           })
-          this.detailData.seeDisabled = false;
         }
       }).catch(error => {
       }).finally(() => {

+ 12 - 5
src/views/financialManagement/billDetails/configuration/mainList.json

@@ -121,24 +121,31 @@
       "index": 9
     },
     {
+      "label": "开票金额",
+      "prop": "invoiceAmount",
+      "width": 120,
+      "overHidden": true,
+      "index": 10
+    },
+    {
       "label": "币别",
       "prop": "currency",
       "width": 120,
       "overHidden": true,
-      "index": 10
+      "index": 11
     },
     {
       "label": "汇率",
       "prop": "exchangeRate",
       "width": 120,
       "overHidden": true,
-      "index": 11
+      "index": 12
     },
     {
       "label": "录入人",
       "prop": "createUserName",
       "overHidden": true,
-      "index": 12,
+      "index": 13,
       "width": 120
     },
     {
@@ -152,13 +159,13 @@
       "format": "yyyy-MM-dd",
       "valueFormat": "yyyy-MM-dd",
       "width": 200,
-      "index": 13
+      "index": 14
     },
     {
       "label": "备注",
       "prop": "remarks",
       "overHidden": true,
-      "index": 14,
+      "index": 15,
       "width": 200
     }
   ]

+ 3 - 9
src/views/financialManagement/incomeInvoice/configuration/detailsPage.json

@@ -16,7 +16,7 @@
   "tree": true,
   "border": true,
   "index": true,
-  "selection": false,
+  "selection": true,
   "menuWidth": 150,
   "dialogClickModal": false,
   "showSummary": true,
@@ -61,25 +61,19 @@
       "index": 7
     },
     {
-      "label": "本次金额",
+      "label": "本次开票金额",
       "prop": "thisAmount",
       "overHidden": true,
       "width": 150,
       "index": 7
     },
     {
-      "label": "币别",
-      "prop": "currency",
-      "index": 7,
-      "width": 120
-    },
-    {
       "label": "备注",
       "prop": "remarks",
       "overHidden": true,
       "index": 13,
       "cell": true,
-      "width": 500
+      "width": 450
     }
   ]
 }

+ 45 - 30
src/views/financialManagement/incomeInvoice/configuration/invoicepage.json

@@ -25,73 +25,88 @@
     {
       "name": "amount",
       "type": "sum"
+    },
+    {
+      "name": "price",
+      "type": "sum"
     }
   ],
   "column": [
     {
-      "label": "货物",
-      "prop": "srcOrderno",
-      "overHidden": true,
-      "width": 200,
-      "index": 2
-    },
-    {
-      "label": "服务名称",
-      "prop": "billNo",
+      "label": "费用项目",
+      "prop": "serverName",
       "overHidden": true,
+      "cell": true,
       "width": 200,
-      "index": 3
-    },
-    {
-      "label": "费用名称",
-      "prop": "itemName",
-      "overHidden": true,
-      "width": 200,
-      "index": 4
+      "index": 4,
+      "rules": [
+        {
+          "required": true,
+          "message": " ",
+          "trigger": "blur"
+        }
+      ]
     },
     {
       "label": "规格型号",
-      "prop": "amount",
+      "prop": "typeno",
       "overHidden": true,
+      "cell": true,
       "width": 150,
-      "index": 7
+      "index": 7,
+      "rules": [
+        {
+          "required": true,
+          "message": " ",
+          "trigger": "blur"
+        }
+      ]
     },
     {
       "label": "单位",
-      "prop": "thisAmount",
+      "prop": "unit",
       "overHidden": true,
       "width": 150,
       "index": 7
     },
     {
       "label": "数量",
-      "prop": "currency",
+      "prop": "number",
+      "value": 1,
       "index": 7,
-      "width": 120
+      "width": 150
     },
     {
       "label": "单价(含税)",
-      "prop": "currency",
+      "prop": "price",
       "index": 7,
-      "width": 120
+      "width": 150
     },
     {
       "label": "金额(含税)",
-      "prop": "currency",
+      "prop": "amount",
       "index": 7,
-      "width": 120
+      "width": 150
     },
     {
       "label": "税率",
-      "prop": "currency",
+      "prop": "amountRate",
       "index": 7,
-      "width": 120
+      "width": 150
     },
     {
       "label": "税额",
-      "prop": "currency",
+      "cell": true,
+      "prop": "amountTax",
       "index": 7,
-      "width": 120
+      "rules": [
+        {
+          "required": true,
+          "message": " ",
+          "trigger": "blur"
+        }
+      ],
+      "width": 400
     }
   ]
 }

+ 24 - 81
src/views/financialManagement/incomeInvoice/configuration/mainList.json

@@ -22,13 +22,9 @@
   "searchIndex": 2,
   "addBtn":false,
   "headerAlign": "center",
-  "showSummary": true,
+  "showSummary": false,
   "summaryText": "合计",
   "sumColumnList": [
-    {
-      "name": "amount",
-      "type": "sum"
-    }
   ],
   "column": [
     {
@@ -40,117 +36,64 @@
       "index": 2
     },
     {
-      "label": "提单号",
-      "prop": "billNo",
-      "search": true,
-      "overHidden": true,
-      "width": 150,
-      "index": 3
-    },
-    {
       "label": "往来单位",
       "prop": "corpId",
       "search": true,
       "hide": true
     },
     {
-      "label": "客户名称",
+      "label": "往来单位",
       "prop": "corpName",
       "overHidden": true,
       "width": 200,
       "index": 4
     },
     {
-      "label": "单据状态",
-      "prop": "financeStatus",
-      "type": "select",
-      "search": true,
+      "label": "开票抬头",
+      "prop": "invoiceTitle",
       "overHidden": true,
-      "index": 1,
-      "width": 120,
-      "dicData": [
-        {
-          "label": "待结算",
-          "value":"待结算"
-        },
-        {
-          "label": "结算完成",
-          "value": "结算完成"
-        }
-      ]
-    },
-    {
-      "label": "人民币金额",
-      "prop": "amount",
-      "overHidden": true,
-      "width": 120,
-      "index": 5
+      "width": 200,
+      "index": 4
     },
     {
-      "label": "外币金额",
-      "prop": "foreignAmount",
+      "label": "开票日期",
+      "prop": "invoiceTime",
+      "type": "date",
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
       "overHidden": true,
-      "width": 120,
-      "index": 5
+      "width": 200,
+      "index": 4
     },
     {
-      "label": "结算日期",
-      "prop": "settlementDate",
+      "label": "发票号",
+      "prop": "invoiceNo",
       "overHidden": true,
-      "type": "date",
-      "search": true,
-      "unlinkPanels": true,
-      "searchRange": true,
-      "width": 150,
-      "index": 6
+      "width": 200,
+      "index": 4
     },
-
     {
-      "label": "银行名称",
-      "prop": "accountBank",
+      "label": "纳税人识别号",
+      "prop": "taxpayerIdentificationNo",
       "overHidden": true,
-      "width": 150,
-      "index": 7
+      "width": 200,
+      "index": 4
     },
     {
-      "label": "银行户头",
-      "prop": "accountName",
+      "label": "开户行账号",
+      "prop": "bankNo",
       "search": true,
       "overHidden": true,
       "width": 150,
       "index": 8
     },
     {
-      "label": "银行卡号",
-      "prop": "accountNo",
-      "overHidden": true,
-      "width": 150,
-      "index": 9
-    },
-    {
-      "label": "申请人",
-      "prop": "createUserName",
-      "overHidden": true,
-      "index": 10,
-      "width": 120
-    },
-    {
-      "label": "申请日期",
-      "prop": "createTime",
-      "overHidden": true,
-      "type": "date",
-      "format": "yyyy-MM-dd",
-      "valueFormat": "yyyy-MM-dd",
-      "width": 150,
-      "index": 11
-    },
-    {
       "label": "备注",
       "prop": "remark",
       "search": true,
       "overHidden": true,
       "index": 12,
-      "width": 120
+      "width": 230
     }
   ]
 }

+ 7 - 12
src/views/financialManagement/incomeInvoice/incomeInvoice.vue

@@ -100,7 +100,7 @@
             id:this.$route.query.params
           }
           this.show = false;
-          this.$store.commit("OUTPUT_IN_DETAIL");
+          this.$store.commit("INCOME_IN_DETAIL");
         }
       }, 100);
     },
@@ -108,7 +108,7 @@
       detailPage
     },
     async created() {
-      // this.option = await this.getColumnData(this.getColumnName(69), option);
+      this.option = await this.getColumnData(this.getColumnName(71), option);
     },
     mounted() {
 
@@ -121,7 +121,7 @@
           status: 1
         };
         this.show = false;
-        this.$store.commit("OUTPUT_IN_DETAIL");
+        this.$store.commit("INCOME_IN_DETAIL");
       },
       //编辑打开
       editOpen(row, status){
@@ -130,7 +130,7 @@
           status: status
         };
         this.show = false;
-        this.$store.commit("OUTPUT_IN_DETAIL");
+        this.$store.commit("INCOME_IN_DETAIL");
       },
       rowDel(row, index, done) {
         if(row.id){
@@ -155,12 +155,6 @@
         this.onLoad(this.page, params);
         done()
       },
-      searchReset() {
-        console.log('1')
-      },
-      selectionChange() {
-        console.log('1')
-      },
       currentChange(val) {
         this.page.currentPage = val
       },
@@ -184,6 +178,7 @@
         this.loading = true
         params =  this.paramsAdjustment(params)
         params.billType = "付费"
+        params.settlementType = 2
 
         getList(page.currentPage, page.pageSize,params).then(res =>{
           this.dataList = res.data.data.records
@@ -201,7 +196,7 @@
       //列保存触发
       async saveColumn() {
         const inSave = await this.saveColumnData(
-          this.getColumnName(69),
+          this.getColumnName(71),
           this.option
         );
         if (inSave) {
@@ -212,7 +207,7 @@
       },
       async resetColumn() {
         const inSave = await this.delColumnData(
-          this.getColumnName(69),
+          this.getColumnName(71),
           option
         );
         if (inSave) {

+ 294 - 239
src/views/financialManagement/incomeInvoice/incomeInvoiceDetailsPage.vue

@@ -6,14 +6,13 @@
                    @click="backToList">返回列表
         </el-button>
         <div class="upper_right_button">
-
-          <el-button type="warning"
-                     class="el-button--small-yh"
+          <el-button class="el-button--small-yh"
+                     type="primary"
                      size="small"
                      :loading="buttonLoading"
                      :disabled="!form.id"
-                     @click.stop="confirmSettlement"
-          >{{financeButton?"付费":"撤销付费"}}
+                     @click.stop="makeInvoice"
+          >{{viewDisabled?'撤销开票':'确认开票'}}
           </el-button>
           <el-button class="el-button--small-yh"
                      type="primary"
@@ -32,7 +31,7 @@
       </el-tab-pane>
     </el-tabs>
 
-    <div class="customer-main" style="margin-top: 1px" v-if="show">
+    <div class="customer-main" style="margin-top: 1px" v-show="show">
       <containerTitle title="基础信息"></containerTitle>
       <basic-container>
         <avue-form class="trading-form" ref="form" v-model="form" :option="option">
@@ -40,7 +39,7 @@
             <crop-select
               v-model="form.corpId"
               corpType="KG"
-              :disabled="!financeDisabled && form.id"
+              :disabled="viewDisabled"
               @getCorpData="returnBack"
               style="width: 100%"
             ></crop-select>
@@ -48,8 +47,8 @@
           <template slot="accountNo">
             <el-select v-model="form.accountNo"
                        placeholder="请选择"
-                       :disabled="!financeDisabled && form.id"
                        @change="accountNoChange"
+                       :disabled="viewDisabled"
                        clearable
                        filterable>
               <el-option v-for="(item,index) in form.bankList"
@@ -60,15 +59,6 @@
               </el-option>
             </el-select>
           </template>
-          <template slot="remark">
-            <el-input type="textarea"
-                      v-model="form.remark"
-                      size="small"
-                      rows="2"
-                      autocomplete="off"
-                      placeholder="">
-            </el-input>
-          </template>
         </avue-form>
       </basic-container>
       <containerTitle title="明细列表"></containerTitle>
@@ -77,7 +67,6 @@
                    :data="dataList"
                    ref="crud"
                    v-model="itemsForm"
-                   :page.sync="page"
                    @search-reset="searchReset"
                    @row-update="rowUpdate"
                    @selection-change="selectionChange"
@@ -87,16 +76,22 @@
                        size="small"
                        :loading="buttonLoading"
                        icon="el-icon-shopping-cart-2"
-                       :disabled="!financeButton"
+                       :disabled="viewDisabled"
                        @click="selectPurchase">选择采购合同
             </el-button>
+            <el-button type="warning"
+                       size="small"
+                       :loading="buttonLoading"
+                       :disabled="selectionList.length === 0 || viewDisabled"
+                       @click="generate">生成开票
+            </el-button>
           </template>
           <template slot-scope="scope" slot="menu">
             <el-button
               type="text"
               size="small"
               icon="el-icon-edit"
-              :disabled="!financeButton"
+              :disabled="viewDisabled"
               @click.stop="rowCell(scope.row,scope.index)"
             > {{ scope.row.$cellEdit ? '修改完成' : '修改' }}
             </el-button>
@@ -104,7 +99,7 @@
               type="text"
               size="small"
               icon="el-icon-delete"
-              :disabled="!financeButton"
+              :disabled="viewDisabled"
               @click.stop="rowDel(scope.row,scope.index)"
             >删除
             </el-button>
@@ -122,6 +117,7 @@
               v-model="row.thisAmount"
               style="width: 90%"
               placeholder="请输入"
+              @change="amountChange"
               size="small"
               oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
             ></el-input>
@@ -129,30 +125,20 @@
           </template>
         </avue-crud>
       </basic-container>
-      <el-dialog
-        title="导入采购"
-        append-to-body
-        class="el-dialogDeep"
-        :visible.sync="billDetailDialog"
-        width="60%"
-        :close-on-click-modal="false"
-        :destroy-on-close="true"
-        :close-on-press-escape="false"
-        top="10vh"
-        v-dialog-drag>
-        <bill-detail
-          :params="params"
-          :billType="billType"
-          @closeFun="closeBillDetail"
-          @importProMent="importProMent"
-        >
-        </bill-detail>
-      </el-dialog>
     </div>
-    <div class="customer-main" style="margin-top: 1px" v-if="!show">
+    <div class="customer-main" style="margin-top: 1px" v-show="!show">
       <containerTitle title="开票信息"></containerTitle>
       <basic-container>
-        <avue-form class="trading-form" ref="forms" v-model="forms" :option="options">
+        <avue-form class="trading-form" ref="form" v-model="form" :option="options">
+          <template slot="remark">
+            <el-input type="textarea"
+                      v-model="form.remark"
+                      size="small"
+                      rows="2"
+                      autocomplete="off"
+                      placeholder="">
+            </el-input>
+          </template>
         </avue-form>
       </basic-container>
       <containerTitle title="明细列表"></containerTitle>
@@ -169,9 +155,8 @@
             <el-button type="primary"
                        size="small"
                        :loading="buttonLoading"
-                       icon="el-icon-shopping-cart-2"
-                       :disabled="!financeButton"
-                       @click="">录入
+                       icon="el-icon-plus"
+                       @click="cellAdd">录入
             </el-button>
           </template>
           <template slot-scope="scope" slot="menu">
@@ -179,41 +164,86 @@
               type="text"
               size="small"
               icon="el-icon-edit"
-              :disabled="!financeButton"
-              @click.stop="rowCell(scope.row,scope.index)"
+              @click.stop="rowCells(scope.row,scope.index)"
             > {{ scope.row.$cellEdit ? '修改完成' : '修改' }}
             </el-button>
             <el-button
               type="text"
               size="small"
               icon="el-icon-delete"
-              :disabled="!financeButton"
-              @click.stop="rowDel(scope.row,scope.index)"
+              @click.stop="rowDels(scope.row,scope.index)"
             >删除
             </el-button>
           </template>
+          <template slot-scope="{row,index}" slot="unit">
+            <span v-if="row.$cellEdit" class="required_fields">*</span>
+            <el-select  v-if="row.$cellEdit" v-model="row.unit" size="small" placeholder="请选择 单位" style="width: 90%" clearable filterable>
+              <el-option v-for="(item,index) in unitDic" :key="index" :label="item.dictValue"  :value="item.dictValue"></el-option>
+            </el-select>
+            <span v-else>{{ row.unit }}</span>
+          </template>
+          <template slot="price" slot-scope="{row,index}">
+            <span v-if="row.$cellEdit" class="required_fields">*</span>
+            <el-input
+              v-if="row.$cellEdit"
+              v-model="row.price"
+              style="width: 90%"
+              placeholder="请输入 单价"
+              size="small"
+              oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
+            ></el-input>
+            <span v-else>{{ row.price }}</span>
+          </template>
+          <template slot="amount" slot-scope="{row,index}">
+            <span v-if="row.$cellEdit" class="required_fields">*</span>
+            <el-input
+              v-if="row.$cellEdit"
+              v-model="row.amount"
+              style="width: 90%"
+              placeholder="请输入 金额"
+              size="small"
+              oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
+            ></el-input>
+            <span v-else>{{ row.amount }}</span>
+          </template>
+          <template slot="amountRate" slot-scope="{row,index}">
+            <span v-if="row.$cellEdit" class="required_fields">*</span>
+            <el-input
+              v-if="row.$cellEdit"
+              v-model="row.amountRate"
+              style="width: 90%"
+              size="small"
+              placeholder="请输入 税率"
+              oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d\d\d\d\d).*$/, "$1.$2")'
+              autocomplete="off"
+            >
+              <i slot="suffix" style="margin-top:3px;margin-right: 10px;display:inline-block">%</i>
+            </el-input>
+            <span v-else>{{ row.amountRate }}</span>
+          </template>
         </avue-crud>
       </basic-container>
-      <el-dialog
-        title="导入采购"
-        append-to-body
-        class="el-dialogDeep"
-        :visible.sync="billDetailDialog"
-        width="60%"
-        :close-on-click-modal="false"
-        :destroy-on-close="true"
-        :close-on-press-escape="false"
-        top="10vh"
-        v-dialog-drag>
-        <bill-detail
-          :params="params"
-          :billType="billType"
-          @closeFun="closeBillDetail"
-          @importProMent="importProMent"
-        >
-        </bill-detail>
-      </el-dialog>
     </div>
+    <el-dialog
+      title="导入采购"
+      append-to-body
+      class="el-dialogDeep"
+      :visible.sync="billDetailDialog"
+      width="60%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :close-on-press-escape="false"
+      top="10vh"
+      v-dialog-drag>
+      <bill-detail
+        :params="params"
+        :billType="billType"
+        :flag="2"
+        @closeFun="closeBillDetail"
+        @importProMent="importProMent"
+      >
+      </bill-detail>
+    </el-dialog>
   </div>
 </template>
 
@@ -221,7 +251,8 @@
   import option from "./configuration/detailsPage.json";
   import options from "./configuration/invoicepage.json";
   import { getDetail,editFinance } from "@/api/financialManagement/financialManagement"
-  import { getDetails,modify,cancelModify,saveOrEdit } from "@/api/financialManagement/paymentRequest";
+  import { saveOrEdit,getDetails } from "@/api/financialManagement/paymentRequest";
+  import { createInvoiceItem,putFund,cancelFund } from "@/api/financialManagement/invoice";
   import { contrastObj,contrastList } from "@/util/contrastData";
   import  billDetail from "@/components/bill/billDetailList";
   import { getlistBankBy } from "@/api/financialManagement/paymentRequest";
@@ -236,25 +267,9 @@
     },
     data() {
       return {
-        form: {},
-        itemsForm:{},
         show:true,
-        itemsOption: option,
-        billDetailDialog:false,
-        buttonLoading:false,
-        financeDisabled:false,
-        financeButton:true,
-        billType:"申请",
-        params:{},
-        id:"",
-        dataList: [],
-        currencyDic:[],
-        page: {
-          pageSize: 10,
-          pagerCount: 5,
-          total: 0,
-        },
-        query:{},
+        viewDisabled:false,
+        form: {},
         option: {
           menuBtn: false,
           labelWidth: 100,
@@ -282,7 +297,7 @@
               span: 8,
               rules: [
                 {
-                  required: true,
+                  required: false,
                   message: ' ',
                   trigger: 'blur'
                 }
@@ -324,7 +339,7 @@
               ]
             },
             {
-              label: '人民币金额',
+              label: '开票金额',
               prop: 'amount',
               span: 8,
               rules: [
@@ -341,18 +356,6 @@
               ]
             },
             {
-              label: '外币金额',
-              prop: 'foreignAmount',
-              span: 8,
-              rules: [
-                {
-                  pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
-                  message: ' ',
-                  trigger: 'blur'
-                }
-              ]
-            },
-            {
               label: '付款日期',
               prop: 'settlementDate',
               format:"yyyy-MM-dd",
@@ -366,12 +369,22 @@
                   trigger: 'blur'
                 }
               ]
-            },
+            }
+          ],
+        },
+        itemsOption: option,
+        itemsForm:{},
+        dataList: [],
+
+        options:{
+          menuBtn: false,
+          labelWidth: 100,
+          column: [
             {
-              label: '制单人',
-              prop: 'createUserName',
+              label: '开票抬头',
+              prop: 'invoiceTitle',
+              sort:true,
               span: 8,
-              disabled:true,
               rules: [
                 {
                   required: false,
@@ -381,11 +394,12 @@
               ]
             },
             {
-              label: '制单日期',
-              prop: 'createTime',
-              span: 8,
+              label: '开票日期',
+              prop: 'invoiceTime',
+              format: "yyyy-MM-dd",
+              valueFormat: "yyyy-MM-dd HH:mm:ss",
               type:"date",
-              disabled:true,
+              span: 8,
               rules: [
                 {
                   required: false,
@@ -395,44 +409,13 @@
               ]
             },
             {
-              label: '备注',
-              prop: 'remark',
-              span:24,
-              minRows: 2,
-              rules: [
-                {
-                  required: false,
-                  message: ' ',
-                  trigger: 'blur'
-                }
-              ]
-            },
-          ],
-        },
-        financeStatusDic:[{
-          label:'正常',
-          value:0
-        },{
-          label:'停用',
-          value:1
-        }],
-        //顶部from数据
-        oldForm:{},
-        oldDataList:[],
-
-        activeName:'first',
-        forms:{},
-        options:{
-          menuBtn: false,
-          labelWidth: 100,
-          column: [
-            {
               label: '发票号',
-              prop: 'sysNo',
+              prop: 'invoiceNo',
               span: 8,
-            },{
-              label: '开票日期',
-              prop: 'srcOrderno',
+            },
+            {
+              label: '纳税人识别号',
+              prop: 'taxpayerIdentificationNo',
               span: 8,
               rules: [
                 {
@@ -441,22 +424,10 @@
                   trigger: 'blur'
                 }
               ]
-            }, {
-              label: '开票抬头',
-              prop: 'corpId',
-              sort:true,
-              span: 8,
-              rules: [
-                {
-                  required: true,
-                  message: ' ',
-                  trigger: 'blur'
-                }
-              ]
             },
             {
-              label: '纳税人识别号',
-              prop: 'accountNo',
+              label: '开户行账号',
+              prop: 'bankNo',
               span: 8,
               rules: [
                 {
@@ -468,7 +439,7 @@
             },
             {
               label: '地址电话',
-              prop: 'accountBank',
+              prop: 'addressPhone',
               span: 8,
               rules: [
                 {
@@ -477,10 +448,12 @@
                   trigger: 'blur'
                 }
               ]
-            }, {
-              label: '开户行账号',
-              prop: 'accountName',
-              span: 8,
+            },
+            {
+              label: '备注',
+              prop: 'remark',
+              span:24,
+              minRows: 2,
               rules: [
                 {
                   required: false,
@@ -492,6 +465,32 @@
           ],
         },
         itemsOptions: options,
+        dataLists:[],
+        itemsForms:{},
+
+        configuration: {
+          multipleChoices: false,
+          multiple: false,
+          disabled: true,
+          searchShow: true,
+          collapseTags: false,
+          placeholder: '请点击右边按钮选择',
+          dicData: []
+        },
+        billDetailDialog:false,
+        buttonLoading:false,
+        billType:"申请",
+        params:{},
+        id:"",
+
+        unitDic:[],
+        currencyDic:[],
+        selectionList:[],
+        activeName:'first',
+        //顶部from数据
+        oldForm:{},
+        oldDataList:[],
+        oldDataLists:[],
       }
     },
     components:{
@@ -502,6 +501,10 @@
       this.getWorkDicts("currency").then(res =>{
         this.currencyDic = res.data.data
       })
+      //单位
+      this.getWorkDicts("unit").then(res => {
+        this.unitDic = res.data.data
+      });
 
       if (this.detailData.id) {
         this.buttonLoading = true
@@ -511,9 +514,6 @@
         }).finally(()=>{
           this.buttonLoading = false
         })
-      }else{
-        this.form.financeStatus = "待结算"
-        this.oldForm.financeStatus = "待结算"
       }
 
       if(this.detailData.params){
@@ -560,6 +560,27 @@
           }
         })
       },
+      amountChange(){
+        let thisAmountList =  this.dataList.map(item => {
+          if(item.thisAmount){
+            return parseFloat(item.thisAmount);
+          }else return 0
+        });
+        this.$set(this.form,"amount",thisAmountList.reduce((n,m) => n + m)) //数组内和
+      },
+      //生成开票
+      generate(){
+        let sum = 0
+        this.selectionList.forEach(item =>{
+          sum =_.add(sum, Number(item.thisAmount))
+        })
+        let params = {
+          price:sum,
+          amount:sum
+        }
+        this.$refs.cruds.rowCellAdd(params);
+        this.show = false
+      },
       selectPurchase(){
         if(!this.form.corpId){
           this.$message.warning("请先选择客户!")
@@ -588,71 +609,116 @@
       rowUpdate(row, index, done) {
         done(row);
       },
+      cellAdd(){
+        this.$refs.cruds.rowCellAdd();
+      },
       rowCell(row,index){
         this.$refs.crud.rowCell(row, index)
-        // row.$cellEdit = !row.$cellEdit
       },
       rowDel(row,index){
-        this.dataList.splice(index, 1);
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.dataList.splice(index, 1);
+        });
+      },
+      rowCells(row,index){
+        this.$refs.cruds.rowCell(row, index)
+      },
+      rowDels(row,index){
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.dataLists.splice(index, 1);
+        });
       },
       searchReset() {
         console.log('1')
       },
-      selectionChange() {
-        console.log('1')
+      selectionChange(row) {
+        this.selectionList = row
       },
-      confirmSettlement(status){
-        this.$refs["form"].validate((valid,done) => {
-          done();
-          if(valid && this.verificationData()){
-            this.$confirm("是否确认付费?", "提示", {
-              confirmButtonText: "确认",
-              cancelButtonText: "取消",
-              type: "warning",
-            }).then(()=>{
-              for (let i = 0; i < this.dataList.length; i++) {
-                if (this.dataList[i].thisAmount == null || this.dataList[i].thisAmount == 0) {
-                  return this.$message.error(`第${i + 1}行的本次金额不能为空`);
-                }
+      makeInvoice(){
+        if(this.verificationData()){
+          this.$confirm(this.viewDisabled?"是否撤销开票":"是否确认开票", "提示", {
+            confirmButtonText: "确认",
+            cancelButtonText: "取消",
+            type: "warning",
+          }).then(()=>{
+            for (let i = 0; i < this.dataList.length; i++) {
+              if (this.dataList[i].thisAmount == (null || "")) {
+                return this.$message.error(`第输入费用明细${i + 1}行的本次金额`);
               }
+            }
 
-              this.buttonLoading = true
-              this.form.billNo = this.dataList.map(item =>{return item.billNo}).join(",")
-
-              const params = {
-                ...this.form,
-                billType:"付费",
-                itemsList:this.dataList
+            for (let i = 0; i < this.dataLists.length; i++) {
+              if (this.dataLists[i].serverName == (null || "") ||
+                this.dataLists[i].typeno == (null || "") ||
+                this.dataLists[i].unit == (null || "") ||
+                this.dataLists[i].price == (null || "") ||
+                this.dataLists[i].amount == (null || "") ||
+                this.dataLists[i].amountRate == (null || "") ||
+                this.dataLists[i].amountTax == (null || "")) {
+                return this.$message.error(`第输入开票明细${i + 1}行的必填项`);
               }
-              if(this.financeButton){
-                modify(params).then(res =>{
+            }
+
+            this.buttonLoading = true
+            this.form.billNo = this.dataList.map(item =>{return item.billNo}).join(",")
+
+            const params = {
+              ...this.form,
+              billType:"付费",
+              itemsList:this.dataList,
+              invoiceItemList:this.dataLists,
+              settlementType:2
+            }
+
+            if(!this.viewDisabled){
+              //确认开票
+              putFund(params).then(res=>{
+                if(res.data.success){
                   this.$message.success("操作成功!")
                   this.afterEcho(res.data.data)
-                }).finally(()=>{
-                  this.buttonLoading = false
-                })
-              }else{
-                cancelModify(params).then(res =>{
+                }
+              }).finally(()=>{
+                this.buttonLoading = false
+              })
+            }else{   //撤销开票
+              cancelFund(params).then(res=>{
+                if(res.data.success){
                   this.$message.success("操作成功!")
                   this.afterEcho(res.data.data)
-                }).finally(()=>{
-                  this.buttonLoading = false
-                })
-              }
-
-            })
-            if(status === true){
-              this.$emit("goBack");
+                }
+              }).finally(()=>{
+                this.buttonLoading = false
+              })
             }
-          }
-        })
+          })
+        }
       },
       saveSettlement(){
         this.$refs["form"].validate((valid,done) => {
           if(valid){
             for (let i = 0; i < this.dataList.length; i++) {
               if (this.dataList[i].thisAmount == (null || "")) {
-                return this.$message.error(`第输入${i + 1}行的本次金额`);
+                return this.$message.error(`第输入费用明细${i + 1}行的本次金额`);
+              }
+            }
+
+            for (let i = 0; i < this.dataLists.length; i++) {
+              if (this.dataLists[i].serverName == (null || "") ||
+                this.dataLists[i].typeno == (null || "") ||
+                this.dataLists[i].unit == (null || "") ||
+                this.dataLists[i].price == (null || "") ||
+                this.dataLists[i].amount == (null || "") ||
+                this.dataLists[i].amountRate == (null || "") ||
+                this.dataLists[i].amountTax == (null || "")) {
+                return this.$message.error(`第输入开票明细${i + 1}行的必填项`);
               }
             }
 
@@ -662,55 +728,44 @@
             const params = {
               ...this.form,
               billType:"付费",
-              itemsList:this.dataList
+              itemsList:this.dataList,
+              invoiceItemList:this.dataLists,
+              settlementType:2
             }
 
             saveOrEdit(params).then(res=>{
               this.$message.success("操作成功!")
               this.afterEcho(res.data.data)
-              done();
             }).finally(()=>{
+              done();
               this.buttonLoading = false
             })
-          }})
+          }
+        })
       },
       afterEcho(data){
         this.form = data;
         this.oldForm = Object.assign({},data);
-        this.financeDisabled =  this.form.financeStatus == "待结算"?true:false;
-        //审核状态为空时  说明为新单进来
-        if(this.financeDisabled){
-          this.financeButton = true
-          this.option.column.forEach(item =>{
-            if( item.prop === "remark" || item.prop === "settlementDate"){
-              this.$set(item,"disabled",false)
-            }else if( item.prop === "createUserName" ||  item.prop === "createTime" ||  item.prop === "sysNo" ){
-              this.$set(item,"disabled",true)
-            }else{
-              this.$set(item,"disabled",false)
-            }
-          })
-        }
-        else{
-          this.financeButton = false
-          this.option.column.forEach(item =>{
-            if( item.prop === "remark"){
-              this.$set(item,"disabled",false)
-            }else if( item.prop === "createUserName" ||  item.prop === "createTime" ||  item.prop === "sysNo"){
-              this.$set(item,"disabled",true)
-            }else{
-              this.$set(item,"disabled",true)
-            }
-          })
-        }
+
+        this.viewDisabled =  data.foundStatus === "核销完成"?true:false;
+
+        this.option.column.forEach(item=>{
+          this.$set(item,"disabled",this.viewDisabled)
+        })
 
         if(data.itemsList){
           this.dataList = data.itemsList
           this.oldDataList = this.deepClone(data.itemsList)
         }
+        if(data.invoiceItemList){
+          this.dataLists = data.invoiceItemList
+          this.oldDataLists = this.deepClone(data.invoiceItemList)
+        }
       },
       verificationData(){
-        if(contrastObj(this.form,this.oldForm) || contrastList(this.dataList,this.oldDataList)
+        if(contrastObj(this.form,this.oldForm)
+          || contrastList(this.dataList,this.oldDataList)
+          || contrastList(this.dataLists,this.oldDataLists)
         ){
           this.$confirm("数据发生变化,请先提交保存!", "提示", {
             confirmButtonText: "保存",

+ 3 - 3
src/views/financialManagement/outputInvoice/configuration/detailsPage.json

@@ -16,7 +16,7 @@
   "tree": true,
   "border": true,
   "index": true,
-  "selection": false,
+  "selection": true,
   "menuWidth": 150,
   "dialogClickModal": false,
   "showSummary": true,
@@ -61,7 +61,7 @@
       "index": 7
     },
     {
-      "label": "本次金额",
+      "label": "本次开票金额",
       "prop": "thisAmount",
       "overHidden": true,
       "width": 150,
@@ -79,7 +79,7 @@
       "overHidden": true,
       "index": 13,
       "cell": true,
-      "width": 500
+      "width": 450
     }
   ]
 }

+ 45 - 30
src/views/financialManagement/outputInvoice/configuration/invoicepage.json

@@ -25,73 +25,88 @@
     {
       "name": "amount",
       "type": "sum"
+    },
+    {
+      "name": "price",
+      "type": "sum"
     }
   ],
   "column": [
     {
-      "label": "货物",
-      "prop": "srcOrderno",
-      "overHidden": true,
-      "width": 200,
-      "index": 2
-    },
-    {
-      "label": "服务名称",
-      "prop": "billNo",
+      "label": "费用项目",
+      "prop": "serverName",
       "overHidden": true,
+      "cell": true,
       "width": 200,
-      "index": 3
-    },
-    {
-      "label": "费用名称",
-      "prop": "itemName",
-      "overHidden": true,
-      "width": 200,
-      "index": 4
+      "index": 4,
+      "rules": [
+        {
+          "required": true,
+          "message": " ",
+          "trigger": "blur"
+        }
+      ]
     },
     {
       "label": "规格型号",
-      "prop": "amount",
+      "prop": "typeno",
       "overHidden": true,
+      "cell": true,
       "width": 150,
-      "index": 7
+      "index": 7,
+      "rules": [
+        {
+          "required": true,
+          "message": " ",
+          "trigger": "blur"
+        }
+      ]
     },
     {
       "label": "单位",
-      "prop": "thisAmount",
+      "prop": "unit",
       "overHidden": true,
       "width": 150,
       "index": 7
     },
     {
       "label": "数量",
-      "prop": "currency",
+      "prop": "number",
+      "value": 1,
       "index": 7,
-      "width": 120
+      "width": 150
     },
     {
       "label": "单价(含税)",
-      "prop": "currency",
+      "prop": "price",
       "index": 7,
-      "width": 120
+      "width": 150
     },
     {
       "label": "金额(含税)",
-      "prop": "currency",
+      "prop": "amount",
       "index": 7,
-      "width": 120
+      "width": 150
     },
     {
       "label": "税率",
-      "prop": "currency",
+      "prop": "amountRate",
       "index": 7,
-      "width": 120
+      "width": 150
     },
     {
       "label": "税额",
-      "prop": "currency",
+      "cell": true,
+      "prop": "amountTax",
       "index": 7,
-      "width": 120
+      "rules": [
+        {
+          "required": true,
+          "message": " ",
+          "trigger": "blur"
+        }
+      ],
+      "width": 400
     }
   ]
 }

+ 24 - 81
src/views/financialManagement/outputInvoice/configuration/mainList.json

@@ -22,13 +22,9 @@
   "searchIndex": 2,
   "addBtn":false,
   "headerAlign": "center",
-  "showSummary": true,
+  "showSummary": false,
   "summaryText": "合计",
   "sumColumnList": [
-    {
-      "name": "amount",
-      "type": "sum"
-    }
   ],
   "column": [
     {
@@ -40,117 +36,64 @@
       "index": 2
     },
     {
-      "label": "提单号",
-      "prop": "billNo",
-      "search": true,
-      "overHidden": true,
-      "width": 150,
-      "index": 3
-    },
-    {
       "label": "往来单位",
       "prop": "corpId",
       "search": true,
       "hide": true
     },
     {
-      "label": "客户名称",
+      "label": "往来单位",
       "prop": "corpName",
       "overHidden": true,
       "width": 200,
       "index": 4
     },
     {
-      "label": "单据状态",
-      "prop": "financeStatus",
-      "type": "select",
-      "search": true,
+      "label": "开票抬头",
+      "prop": "invoiceTitle",
       "overHidden": true,
-      "index": 1,
-      "width": 120,
-      "dicData": [
-        {
-          "label": "待结算",
-          "value":"待结算"
-        },
-        {
-          "label": "结算完成",
-          "value": "结算完成"
-        }
-      ]
-    },
-    {
-      "label": "人民币金额",
-      "prop": "amount",
-      "overHidden": true,
-      "width": 120,
-      "index": 5
+      "width": 200,
+      "index": 4
     },
     {
-      "label": "外币金额",
-      "prop": "foreignAmount",
+      "label": "开票日期",
+      "prop": "invoiceTime",
+      "type": "date",
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
       "overHidden": true,
-      "width": 120,
-      "index": 5
+      "width": 200,
+      "index": 4
     },
     {
-      "label": "结算日期",
-      "prop": "settlementDate",
+      "label": "发票号",
+      "prop": "invoiceNo",
       "overHidden": true,
-      "type": "date",
-      "search": true,
-      "unlinkPanels": true,
-      "searchRange": true,
-      "width": 150,
-      "index": 6
+      "width": 200,
+      "index": 4
     },
-
     {
-      "label": "银行名称",
-      "prop": "accountBank",
+      "label": "纳税人识别号",
+      "prop": "taxpayerIdentificationNo",
       "overHidden": true,
-      "width": 150,
-      "index": 7
+      "width": 200,
+      "index": 4
     },
     {
-      "label": "银行户头",
-      "prop": "accountName",
+      "label": "开户行账号",
+      "prop": "bankNo",
       "search": true,
       "overHidden": true,
       "width": 150,
       "index": 8
     },
     {
-      "label": "银行卡号",
-      "prop": "accountNo",
-      "overHidden": true,
-      "width": 150,
-      "index": 9
-    },
-    {
-      "label": "申请人",
-      "prop": "createUserName",
-      "overHidden": true,
-      "index": 10,
-      "width": 120
-    },
-    {
-      "label": "申请日期",
-      "prop": "createTime",
-      "overHidden": true,
-      "type": "date",
-      "format": "yyyy-MM-dd",
-      "valueFormat": "yyyy-MM-dd",
-      "width": 150,
-      "index": 11
-    },
-    {
       "label": "备注",
       "prop": "remark",
       "search": true,
       "overHidden": true,
       "index": 12,
-      "width": 120
+      "width": 230
     }
   ]
 }

+ 2 - 1
src/views/financialManagement/outputInvoice/outputInvoice.vue

@@ -183,7 +183,8 @@
       onLoad(page, params) {
         this.loading = true
         params =  this.paramsAdjustment(params)
-        params.billType = "付费"
+        params.billType = "收费"
+        params.settlementType = 2
 
         getList(page.currentPage, page.pageSize,params).then(res =>{
           this.dataList = res.data.data.records

+ 295 - 228
src/views/financialManagement/outputInvoice/outputInvoiceDetailsPage.vue

@@ -6,14 +6,13 @@
                    @click="backToList">返回列表
         </el-button>
         <div class="upper_right_button">
-
-          <el-button type="warning"
-                     class="el-button--small-yh"
+          <el-button class="el-button--small-yh"
+                     type="primary"
                      size="small"
                      :loading="buttonLoading"
                      :disabled="!form.id"
-                     @click.stop="confirmSettlement"
-          >{{financeButton?"付费":"撤销付费"}}
+                     @click.stop="makeInvoice"
+          >{{viewDisabled?'撤销开票':'确认开票'}}
           </el-button>
           <el-button class="el-button--small-yh"
                      type="primary"
@@ -32,7 +31,7 @@
       </el-tab-pane>
     </el-tabs>
 
-    <div class="customer-main" style="margin-top: 1px" v-if="show">
+    <div class="customer-main" style="margin-top: 1px" v-show="show">
       <containerTitle title="基础信息"></containerTitle>
       <basic-container>
         <avue-form class="trading-form" ref="form" v-model="form" :option="option">
@@ -40,7 +39,7 @@
             <crop-select
               v-model="form.corpId"
               corpType="KG"
-              :disabled="!financeDisabled && form.id"
+              :disabled="viewDisabled"
               @getCorpData="returnBack"
               style="width: 100%"
             ></crop-select>
@@ -48,8 +47,8 @@
           <template slot="accountNo">
             <el-select v-model="form.accountNo"
                        placeholder="请选择"
-                       :disabled="!financeDisabled && form.id"
                        @change="accountNoChange"
+                       :disabled="viewDisabled"
                        clearable
                        filterable>
               <el-option v-for="(item,index) in form.bankList"
@@ -60,15 +59,6 @@
               </el-option>
             </el-select>
           </template>
-          <template slot="remark">
-            <el-input type="textarea"
-                      v-model="form.remark"
-                      size="small"
-                      rows="2"
-                      autocomplete="off"
-                      placeholder="">
-            </el-input>
-          </template>
         </avue-form>
       </basic-container>
       <containerTitle title="明细列表"></containerTitle>
@@ -77,7 +67,6 @@
                    :data="dataList"
                    ref="crud"
                    v-model="itemsForm"
-                   :page.sync="page"
                    @search-reset="searchReset"
                    @row-update="rowUpdate"
                    @selection-change="selectionChange"
@@ -87,8 +76,14 @@
                        size="small"
                        :loading="buttonLoading"
                        icon="el-icon-shopping-cart-2"
-                       :disabled="!financeButton"
-                       @click="selectPurchase">选择采购合同
+                       :disabled="viewDisabled"
+                       @click="selectPurchase">选择销售合同
+            </el-button>
+            <el-button type="warning"
+                       size="small"
+                       :loading="buttonLoading"
+                       :disabled="selectionList.length === 0 || viewDisabled"
+                       @click="generate">生成开票
             </el-button>
           </template>
           <template slot-scope="scope" slot="menu">
@@ -96,7 +91,7 @@
               type="text"
               size="small"
               icon="el-icon-edit"
-              :disabled="!financeButton"
+              :disabled="viewDisabled"
               @click.stop="rowCell(scope.row,scope.index)"
             > {{ scope.row.$cellEdit ? '修改完成' : '修改' }}
             </el-button>
@@ -104,7 +99,7 @@
               type="text"
               size="small"
               icon="el-icon-delete"
-              :disabled="!financeButton"
+              :disabled="viewDisabled"
               @click.stop="rowDel(scope.row,scope.index)"
             >删除
             </el-button>
@@ -123,36 +118,27 @@
               style="width: 90%"
               placeholder="请输入"
               size="small"
+              @change="amountChange"
               oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
             ></el-input>
             <span v-else>{{ row.thisAmount }}</span>
           </template>
         </avue-crud>
       </basic-container>
-      <el-dialog
-        title="导入采购"
-        append-to-body
-        class="el-dialogDeep"
-        :visible.sync="billDetailDialog"
-        width="60%"
-        :close-on-click-modal="false"
-        :destroy-on-close="true"
-        :close-on-press-escape="false"
-        top="10vh"
-        v-dialog-drag>
-        <bill-detail
-          :params="params"
-          :billType="billType"
-          @closeFun="closeBillDetail"
-          @importProMent="importProMent"
-        >
-        </bill-detail>
-      </el-dialog>
     </div>
-    <div class="customer-main" style="margin-top: 1px" v-if="!show">
+    <div class="customer-main" style="margin-top: 1px" v-show="!show">
       <containerTitle title="开票信息"></containerTitle>
       <basic-container>
-        <avue-form class="trading-form" ref="forms" v-model="forms" :option="options">
+        <avue-form class="trading-form" ref="form" v-model="form" :option="options">
+          <template slot="remark">
+            <el-input type="textarea"
+                      v-model="form.remark"
+                      size="small"
+                      rows="2"
+                      autocomplete="off"
+                      placeholder="">
+            </el-input>
+          </template>
         </avue-form>
       </basic-container>
       <containerTitle title="明细列表"></containerTitle>
@@ -169,9 +155,8 @@
             <el-button type="primary"
                        size="small"
                        :loading="buttonLoading"
-                       icon="el-icon-shopping-cart-2"
-                       :disabled="!financeButton"
-                       @click="">录入
+                       icon="el-icon-plus"
+                       @click="cellAdd">录入
             </el-button>
           </template>
           <template slot-scope="scope" slot="menu">
@@ -179,41 +164,86 @@
               type="text"
               size="small"
               icon="el-icon-edit"
-              :disabled="!financeButton"
-              @click.stop="rowCell(scope.row,scope.index)"
+              @click.stop="rowCells(scope.row,scope.index)"
             > {{ scope.row.$cellEdit ? '修改完成' : '修改' }}
             </el-button>
             <el-button
               type="text"
               size="small"
               icon="el-icon-delete"
-              :disabled="!financeButton"
-              @click.stop="rowDel(scope.row,scope.index)"
+              @click.stop="rowDels(scope.row,scope.index)"
             >删除
             </el-button>
           </template>
+          <template slot-scope="{row,index}" slot="unit">
+            <span v-if="row.$cellEdit" class="required_fields">*</span>
+            <el-select  v-if="row.$cellEdit" v-model="row.unit" size="small" placeholder="请选择 单位" style="width: 90%" clearable filterable>
+              <el-option v-for="(item,index) in unitDic" :key="index" :label="item.dictValue"  :value="item.dictValue"></el-option>
+            </el-select>
+            <span v-else>{{ row.unit }}</span>
+          </template>
+          <template slot="price" slot-scope="{row,index}">
+            <span v-if="row.$cellEdit" class="required_fields">*</span>
+            <el-input
+              v-if="row.$cellEdit"
+              v-model="row.price"
+              style="width: 90%"
+              placeholder="请输入 单价"
+              size="small"
+              oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
+            ></el-input>
+            <span v-else>{{ row.price }}</span>
+          </template>
+          <template slot="amount" slot-scope="{row,index}">
+            <span v-if="row.$cellEdit" class="required_fields">*</span>
+            <el-input
+              v-if="row.$cellEdit"
+              v-model="row.amount"
+              style="width: 90%"
+              placeholder="请输入 金额"
+              size="small"
+              oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
+            ></el-input>
+            <span v-else>{{ row.amount }}</span>
+          </template>
+          <template slot="amountRate" slot-scope="{row,index}">
+            <span v-if="row.$cellEdit" class="required_fields">*</span>
+            <el-input
+              v-if="row.$cellEdit"
+              v-model="row.amountRate"
+              style="width: 90%"
+              size="small"
+              placeholder="请输入 税率"
+              oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d\d\d\d\d).*$/, "$1.$2")'
+              autocomplete="off"
+            >
+              <i slot="suffix" style="margin-top:3px;margin-right: 10px;display:inline-block">%</i>
+            </el-input>
+            <span v-else>{{ row.amountRate }}</span>
+          </template>
         </avue-crud>
       </basic-container>
-      <el-dialog
-        title="导入采购"
-        append-to-body
-        class="el-dialogDeep"
-        :visible.sync="billDetailDialog"
-        width="60%"
-        :close-on-click-modal="false"
-        :destroy-on-close="true"
-        :close-on-press-escape="false"
-        top="10vh"
-        v-dialog-drag>
-        <bill-detail
-          :params="params"
-          :billType="billType"
-          @closeFun="closeBillDetail"
-          @importProMent="importProMent"
-        >
-        </bill-detail>
-      </el-dialog>
     </div>
+    <el-dialog
+      title="导入销售"
+      append-to-body
+      class="el-dialogDeep"
+      :visible.sync="billDetailDialog"
+      width="60%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :close-on-press-escape="false"
+      top="10vh"
+      v-dialog-drag>
+      <bill-detail
+        :params="params"
+        :billType="billType"
+        :flag="2"
+        @closeFun="closeBillDetail"
+        @importProMent="importProMent"
+      >
+      </bill-detail>
+    </el-dialog>
   </div>
 </template>
 
@@ -221,7 +251,8 @@
   import option from "./configuration/detailsPage.json";
   import options from "./configuration/invoicepage.json";
   import { getDetail,editFinance } from "@/api/financialManagement/financialManagement"
-  import { getDetails,modify,cancelModify,saveOrEdit } from "@/api/financialManagement/paymentRequest";
+  import { saveOrEdit,getDetails } from "@/api/financialManagement/paymentRequest";
+  import { createInvoiceItem,putFund,cancelFund } from "@/api/financialManagement/invoice";
   import { contrastObj,contrastList } from "@/util/contrastData";
   import  billDetail from "@/components/bill/billDetailList";
   import { getlistBankBy } from "@/api/financialManagement/paymentRequest";
@@ -236,25 +267,9 @@
     },
     data() {
       return {
-        form: {},
-        itemsForm:{},
         show:true,
-        itemsOption: option,
-        billDetailDialog:false,
-        buttonLoading:false,
-        financeDisabled:false,
-        financeButton:true,
-        billType:"申请",
-        params:{},
-        id:"",
-        dataList: [],
-        currencyDic:[],
-        page: {
-          pageSize: 10,
-          pagerCount: 5,
-          total: 0,
-        },
-        query:{},
+        viewDisabled:false,
+        form: {},
         option: {
           menuBtn: false,
           labelWidth: 100,
@@ -282,7 +297,7 @@
               span: 8,
               rules: [
                 {
-                  required: true,
+                  required: false,
                   message: ' ',
                   trigger: 'blur'
                 }
@@ -366,12 +381,22 @@
                   trigger: 'blur'
                 }
               ]
-            },
+            }
+          ],
+        },
+        itemsOption: option,
+        itemsForm:{},
+        dataList: [],
+
+        options:{
+          menuBtn: false,
+          labelWidth: 100,
+          column: [
             {
-              label: '制单人',
-              prop: 'createUserName',
+              label: '开票抬头',
+              prop: 'invoiceTitle',
+              sort:true,
               span: 8,
-              disabled:true,
               rules: [
                 {
                   required: false,
@@ -381,24 +406,12 @@
               ]
             },
             {
-              label: '制单日期',
-              prop: 'createTime',
-              span: 8,
+              label: '开票日期',
+              prop: 'invoiceTime',
+              format: "yyyy-MM-dd",
+              valueFormat: "yyyy-MM-dd HH:mm:ss",
               type:"date",
-              disabled:true,
-              rules: [
-                {
-                  required: false,
-                  message: ' ',
-                  trigger: 'blur'
-                }
-              ]
-            },
-            {
-              label: '备注',
-              prop: 'remark',
-              span:24,
-              minRows: 2,
+              span: 8,
               rules: [
                 {
                   required: false,
@@ -407,32 +420,14 @@
                 }
               ]
             },
-          ],
-        },
-        financeStatusDic:[{
-          label:'正常',
-          value:0
-        },{
-          label:'停用',
-          value:1
-        }],
-        //顶部from数据
-        oldForm:{},
-        oldDataList:[],
-
-        activeName:'first',
-        forms:{},
-        options:{
-          menuBtn: false,
-          labelWidth: 100,
-          column: [
             {
               label: '发票号',
-              prop: 'sysNo',
+              prop: 'invoiceNo',
               span: 8,
-            },{
-              label: '开票日期',
-              prop: 'srcOrderno',
+            },
+            {
+              label: '纳税人识别号',
+              prop: 'taxpayerIdentificationNo',
               span: 8,
               rules: [
                 {
@@ -441,22 +436,10 @@
                   trigger: 'blur'
                 }
               ]
-            }, {
-              label: '开票抬头',
-              prop: 'corpId',
-              sort:true,
-              span: 8,
-              rules: [
-                {
-                  required: true,
-                  message: ' ',
-                  trigger: 'blur'
-                }
-              ]
             },
             {
-              label: '纳税人识别号',
-              prop: 'accountNo',
+              label: '开户行账号',
+              prop: 'bankNo',
               span: 8,
               rules: [
                 {
@@ -468,7 +451,7 @@
             },
             {
               label: '地址电话',
-              prop: 'accountBank',
+              prop: 'addressPhone',
               span: 8,
               rules: [
                 {
@@ -477,10 +460,12 @@
                   trigger: 'blur'
                 }
               ]
-            }, {
-              label: '开户行账号',
-              prop: 'accountName',
-              span: 8,
+            },
+            {
+              label: '备注',
+              prop: 'remark',
+              span:24,
+              minRows: 2,
               rules: [
                 {
                   required: false,
@@ -492,6 +477,32 @@
           ],
         },
         itemsOptions: options,
+        dataLists:[],
+        itemsForms:{},
+
+        configuration: {
+          multipleChoices: false,
+          multiple: false,
+          disabled: true,
+          searchShow: true,
+          collapseTags: false,
+          placeholder: '请点击右边按钮选择',
+          dicData: []
+        },
+        billDetailDialog:false,
+        buttonLoading:false,
+        billType:"收费",
+        params:{},
+        id:"",
+
+        unitDic:[],
+        currencyDic:[],
+        selectionList:[],
+        activeName:'first',
+        //顶部from数据
+        oldForm:{},
+        oldDataList:[],
+        oldDataLists:[],
       }
     },
     components:{
@@ -502,6 +513,10 @@
       this.getWorkDicts("currency").then(res =>{
         this.currencyDic = res.data.data
       })
+      //单位
+      this.getWorkDicts("unit").then(res => {
+        this.unitDic = res.data.data
+      });
 
       if (this.detailData.id) {
         this.buttonLoading = true
@@ -511,9 +526,6 @@
         }).finally(()=>{
           this.buttonLoading = false
         })
-      }else{
-        this.form.financeStatus = "待结算"
-        this.oldForm.financeStatus = "待结算"
       }
 
       if(this.detailData.params){
@@ -551,6 +563,14 @@
           this.$set(this.form,"bankList",res.data)
         })
       },
+      amountChange(){
+        let thisAmountList =  this.dataList.map(item => {
+          if(item.thisAmount){
+            return parseFloat(item.thisAmount);
+          }else return 0
+        });
+        this.$set(this.form,"amount",thisAmountList.reduce((n,m) => n + m)) //数组内和
+      },
       //选择卡号
       accountNoChange(value){
         this.form.bankList.forEach(item =>{
@@ -560,6 +580,19 @@
           }
         })
       },
+      //生成开票
+      generate(){
+        let sum = 0
+        this.selectionList.forEach(item =>{
+          sum =_.add(sum, Number(item.thisAmount))
+        })
+        let params = {
+          price:sum,
+          amount:sum
+        }
+        this.$refs.cruds.rowCellAdd(params);
+        this.show = false
+      },
       selectPurchase(){
         if(!this.form.corpId){
           this.$message.warning("请先选择客户!")
@@ -588,71 +621,116 @@
       rowUpdate(row, index, done) {
         done(row);
       },
+      cellAdd(){
+        this.$refs.cruds.rowCellAdd();
+      },
       rowCell(row,index){
         this.$refs.crud.rowCell(row, index)
-        // row.$cellEdit = !row.$cellEdit
       },
       rowDel(row,index){
-        this.dataList.splice(index, 1);
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.dataList.splice(index, 1);
+        });
+      },
+      rowCells(row,index){
+        this.$refs.cruds.rowCell(row, index)
+      },
+      rowDels(row,index){
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.dataLists.splice(index, 1);
+        });
       },
       searchReset() {
         console.log('1')
       },
-      selectionChange() {
-        console.log('1')
+      selectionChange(row) {
+        this.selectionList = row
       },
-      confirmSettlement(status){
-        this.$refs["form"].validate((valid,done) => {
-          done();
-          if(valid && this.verificationData()){
-            this.$confirm("是否确认付费?", "提示", {
-              confirmButtonText: "确认",
-              cancelButtonText: "取消",
-              type: "warning",
-            }).then(()=>{
-              for (let i = 0; i < this.dataList.length; i++) {
-                if (this.dataList[i].thisAmount == null || this.dataList[i].thisAmount == 0) {
-                  return this.$message.error(`第${i + 1}行的本次金额不能为空`);
-                }
+      makeInvoice(){
+        if(this.verificationData()){
+          this.$confirm(this.viewDisabled?"是否撤销开票":"是否确认开票", "提示", {
+            confirmButtonText: "确认",
+            cancelButtonText: "取消",
+            type: "warning",
+          }).then(()=>{
+            for (let i = 0; i < this.dataList.length; i++) {
+              if (this.dataList[i].thisAmount == (null || "")) {
+                return this.$message.error(`第输入费用明细${i + 1}行的本次金额`);
               }
+            }
 
-              this.buttonLoading = true
-              this.form.billNo = this.dataList.map(item =>{return item.billNo}).join(",")
-
-              const params = {
-                ...this.form,
-                billType:"付费",
-                itemsList:this.dataList
+            for (let i = 0; i < this.dataLists.length; i++) {
+              if (this.dataLists[i].serverName == (null || "") ||
+                this.dataLists[i].typeno == (null || "") ||
+                this.dataLists[i].unit == (null || "") ||
+                this.dataLists[i].price == (null || "") ||
+                this.dataLists[i].amount == (null || "") ||
+                this.dataLists[i].amountRate == (null || "") ||
+                this.dataLists[i].amountTax == (null || "")) {
+                return this.$message.error(`第输入开票明细${i + 1}行的必填项`);
               }
-              if(this.financeButton){
-                modify(params).then(res =>{
+            }
+
+            this.buttonLoading = true
+            this.form.billNo = this.dataList.map(item =>{return item.billNo}).join(",")
+
+            const params = {
+              ...this.form,
+              billType:"收费",
+              itemsList:this.dataList,
+              invoiceItemList:this.dataLists,
+              settlementType:2
+            }
+
+            if(!this.viewDisabled){
+              //确认开票
+              putFund(params).then(res=>{
+                if(res.data.success){
                   this.$message.success("操作成功!")
                   this.afterEcho(res.data.data)
-                }).finally(()=>{
-                  this.buttonLoading = false
-                })
-              }else{
-                cancelModify(params).then(res =>{
+                }
+              }).finally(()=>{
+                this.buttonLoading = false
+              })
+            }else{   //撤销开票
+              cancelFund(params).then(res=>{
+                if(res.data.success){
                   this.$message.success("操作成功!")
                   this.afterEcho(res.data.data)
-                }).finally(()=>{
-                  this.buttonLoading = false
-                })
-              }
-
-            })
-            if(status === true){
-              this.$emit("goBack");
+                }
+              }).finally(()=>{
+                this.buttonLoading = false
+              })
             }
-          }
-        })
+          })
+        }
       },
       saveSettlement(){
         this.$refs["form"].validate((valid,done) => {
           if(valid){
             for (let i = 0; i < this.dataList.length; i++) {
               if (this.dataList[i].thisAmount == (null || "")) {
-                return this.$message.error(`第输入${i + 1}行的本次金额`);
+                return this.$message.error(`第输入费用明细${i + 1}行的本次金额`);
+              }
+            }
+
+            for (let i = 0; i < this.dataLists.length; i++) {
+              if (this.dataLists[i].serverName == (null || "") ||
+                this.dataLists[i].typeno == (null || "") ||
+                this.dataLists[i].unit == (null || "") ||
+                this.dataLists[i].price == (null || "") ||
+                this.dataLists[i].amount == (null || "") ||
+                this.dataLists[i].amountRate == (null || "") ||
+                this.dataLists[i].amountTax == (null || "")) {
+                return this.$message.error(`第输入开票明细${i + 1}行的必填项`);
               }
             }
 
@@ -661,56 +739,45 @@
 
             const params = {
               ...this.form,
-              billType:"付费",
-              itemsList:this.dataList
+              billType:"收费",
+              itemsList:this.dataList,
+              invoiceItemList:this.dataLists,
+              settlementType:2
             }
 
             saveOrEdit(params).then(res=>{
               this.$message.success("操作成功!")
               this.afterEcho(res.data.data)
-              done();
             }).finally(()=>{
+              done();
               this.buttonLoading = false
             })
-          }})
+          }
+        })
       },
       afterEcho(data){
         this.form = data;
         this.oldForm = Object.assign({},data);
-        this.financeDisabled =  this.form.financeStatus == "待结算"?true:false;
-        //审核状态为空时  说明为新单进来
-        if(this.financeDisabled){
-          this.financeButton = true
-          this.option.column.forEach(item =>{
-            if( item.prop === "remark" || item.prop === "settlementDate"){
-              this.$set(item,"disabled",false)
-            }else if( item.prop === "createUserName" ||  item.prop === "createTime" ||  item.prop === "sysNo" ){
-              this.$set(item,"disabled",true)
-            }else{
-              this.$set(item,"disabled",false)
-            }
-          })
-        }
-        else{
-          this.financeButton = false
-          this.option.column.forEach(item =>{
-            if( item.prop === "remark"){
-              this.$set(item,"disabled",false)
-            }else if( item.prop === "createUserName" ||  item.prop === "createTime" ||  item.prop === "sysNo"){
-              this.$set(item,"disabled",true)
-            }else{
-              this.$set(item,"disabled",true)
-            }
-          })
-        }
+
+        this.viewDisabled =  data.foundStatus === "核销完成"?true:false;
+
+        this.option.column.forEach(item=>{
+          this.$set(item,"disabled",this.viewDisabled)
+        })
 
         if(data.itemsList){
           this.dataList = data.itemsList
           this.oldDataList = this.deepClone(data.itemsList)
         }
+        if(data.invoiceItemList){
+          this.dataLists = data.invoiceItemList
+          this.oldDataLists = this.deepClone(data.invoiceItemList)
+        }
       },
       verificationData(){
-        if(contrastObj(this.form,this.oldForm) || contrastList(this.dataList,this.oldDataList)
+        if(contrastObj(this.form,this.oldForm)
+          || contrastList(this.dataList,this.oldDataList)
+          || contrastList(this.dataLists,this.oldDataLists)
         ){
           this.$confirm("数据发生变化,请先提交保存!", "提示", {
             confirmButtonText: "保存",

+ 1 - 0
src/views/financialManagement/paymentSettle/paymentSettleDetailsPage.vue

@@ -152,6 +152,7 @@
         <bill-detail
           :params="params"
           :billType="billType"
+          :flag="1"
           @closeFun="closeBillDetail"
           @importProMent="importProMent"
         >

+ 1 - 0
src/views/financialManagement/receiptSettle/receiptSettleDetailsPage.vue

@@ -160,6 +160,7 @@
         <bill-detail
           :params="params"
           :billType="billType"
+          :flag="1"
           @closeFun="closeBillDetail"
           @importProMent="importProMent"
         >

+ 53 - 14
src/views/purchase/contract/detailsPage.vue

@@ -14,29 +14,39 @@
                    @click.stop="openDisabled()">编辑
         </el-button>
 
-        <el-dropdown style="padding: 0 8px;line-height: 0">
+        <el-dropdown style="padding: 0 6px;line-height: 0">
+          <el-button
+            type="primary"
+            size="small"
+            :loading="buttonLoading"
+            :disabled="!form.id || checkDisabled"
+          >
+            审核处理<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item  :loading="buttonLoading" @click.native="auditCheck">审核数据</el-dropdown-item>
+            <el-dropdown-item v-if="false" @click.native="">审核进度</el-dropdown-item>
+            <el-dropdown-item v-if="false">撤销审核</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+
+        <el-dropdown style="padding: 0 6px;line-height: 0">
           <el-button
             type="warning"
             :loading="buttonLoading"
-            :disabled="!form.id || viewDisabled"
+            :disabled="!form.id || checkDisabled"
             size="small"
           >
             账单处理<i class="el-icon-arrow-down el-icon--right"></i>
           </el-button>
           <el-dropdown-menu slot="dropdown">
             <el-dropdown-item
-              :loading="buttonLoading"
-              :disabled="!form.id || viewDisabled"
               @click.native="applyPayment('申请')">申请货款
             </el-dropdown-item>
             <el-dropdown-item
-              :loading="buttonLoading"
-              :disabled="!form.id  || viewDisabled"
               @click.native="applyPayment('收费')">申请退款
             </el-dropdown-item>
             <el-dropdown-item
-              :loading="buttonLoading"
-              :disabled="!form.id  || viewDisabled"
               @click.native="openApplicationDialog">查看账单
             </el-dropdown-item>
           </el-dropdown-menu>
@@ -46,20 +56,16 @@
           <el-button
             type="success"
             :loading="buttonLoading"
-            :disabled="!form.id || viewDisabled"
+            :disabled="!form.id || checkDisabled"
             size="small"
           >
             业务处理<i class="el-icon-arrow-down el-icon--right"></i>
           </el-button>
           <el-dropdown-menu slot="dropdown">
             <el-dropdown-item
-              :loading="buttonLoading"
-              :disabled="!form.id  || viewDisabled"
               @click.native="createData()">创建单据
             </el-dropdown-item>
             <el-dropdown-item
-              :loading="buttonLoading"
-              :disabled="!form.id  || viewDisabled"
               @click.native="copyData()">复制单据
             </el-dropdown-item>
           </el-dropdown-menu>
@@ -69,7 +75,7 @@
           class="el-button--small-yh "
           type="primary"
           size="small"
-          :disabled="disabled  || viewDisabled"
+          :disabled="disabled  || checkDisabled"
           @click="editCustomer"
           :loading="buttonLoading"
         >保存数据
@@ -381,6 +387,7 @@ import { corpsattn } from "@/api/basicData/configuration"
 import { contrastObj,contrastList } from "@/util/contrastData";
 import ApplyPayment from "../../../components/finance/applyPayment";
 import financialAccount from "../../../components/finance/financialAccount";
+import { pleaseCheck } from "@/api/basicData/configuration"
 
 export default {
   name: "detailsPage",
@@ -419,6 +426,7 @@ export default {
       commodityData: false,
       takeDisabled:false, //收货状态
       viewDisabled:false,//查看状态
+      checkDisabled:false,
       tableData: [],
       billType:"",
       billData:{},
@@ -741,6 +749,7 @@ export default {
 
     if(this.detailData.view){
       this.viewDisabled = true
+      this.checkDisabled = true
     }
 
     if (this.detailData.id) {
@@ -941,6 +950,7 @@ export default {
     },
     openDisabled(){
       this.viewDisabled = false
+      this.checkDisabled = false
     },
     selectionContact(row){
       this.selectContact = row;
@@ -998,6 +1008,35 @@ export default {
         this.financialAccountDialog = true;
       }
     },
+    //请核
+    auditCheck(){
+      if(this.verificationData()){
+        this.$confirm("确定审核此订单?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(()=>{
+          this.buttonLoading = true
+          const data = {
+            id : this.form.id,
+            checkType: 'cgqh',
+            url: '/purchase/contract/index',
+            pageStatus:"this.$store.getters.importCGStatus",
+            pageLabel:"采购订单(I)",
+            checkFlag: 1,
+          }
+
+          pleaseCheck(data).then(res=>{
+            if(res.data.success){
+              this.$message.success("操作成功!")
+              this.viewDisabled = true
+            }
+          })
+        }).finally(()=>{
+          this.buttonLoading = false
+        })
+      }
+    },
     //新增商品明细保存触发
     rowSave(row, done, loading) {
       // this.contactsData.push(row)

+ 51 - 12
src/views/salesManagement/salesContract/detailsPage.vue

@@ -15,28 +15,39 @@
                    @click.stop="openDisabled()">编辑
         </el-button>
 
+        <el-dropdown style="padding: 0 6px;line-height: 0">
+          <el-button
+            type="primary"
+            size="small"
+            :loading="buttonLoading"
+            :disabled="!form.id || checkDisabled"
+          >
+            审核处理<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item  :loading="buttonLoading" @click.native="auditCheck">审核数据</el-dropdown-item>
+            <el-dropdown-item v-if="false" @click.native="">审核进度</el-dropdown-item>
+            <el-dropdown-item v-if="false">撤销审核</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+
         <el-dropdown style="padding: 0 8px;line-height: 0">
           <el-button
             type="warning"
             :loading="buttonLoading"
-            :disabled="!form.id || viewDisabled"
+            :disabled="!form.id || checkDisabled"
             size="small"
           >
             账单处理<i class="el-icon-arrow-down el-icon--right"></i>
           </el-button>
           <el-dropdown-menu slot="dropdown">
             <el-dropdown-item
-              :disabled="!form.id || viewDisabled"
-              :loading="buttonLoading"
               @click.native="applySettlement('收费')">生成账单
             </el-dropdown-item>
             <el-dropdown-item
-              :disabled="!form.id  || viewDisabled"
-              :loading="buttonLoading"
               @click.native="applySettlement('申请')">申请退款
             </el-dropdown-item>
             <el-dropdown-item
-              :loading="buttonLoading"
               @click.native="openApplicationDialog">查看账单
             </el-dropdown-item>
           </el-dropdown-menu>
@@ -46,20 +57,16 @@
           <el-button
             type="success"
             :loading="buttonLoading"
-            :disabled="!form.id || viewDisabled"
+            :disabled="!form.id || checkDisabled"
             size="small"
           >
             业务处理<i class="el-icon-arrow-down el-icon--right"></i>
           </el-button>
           <el-dropdown-menu slot="dropdown">
             <el-dropdown-item
-              :loading="buttonLoading"
-              :disabled="!form.id  || viewDisabled"
               @click.native="createData()">创建单据
             </el-dropdown-item>
             <el-dropdown-item
-              :loading="buttonLoading"
-              :disabled="!form.id  || viewDisabled"
               @click.native="copyData()">复制单据
             </el-dropdown-item>
           </el-dropdown-menu>
@@ -69,7 +76,7 @@
           class="el-button--small-yh"
           type="primary"
           size="small"
-          :disabled="disabled || viewDisabled"
+          :disabled="disabled || checkDisabled"
           :loading="buttonLoading"
           @click="editCustomer"
         >保存数据
@@ -438,6 +445,7 @@ export default {
       applySettlementDialog:false,
       financialAccountDialog:false,
       applicationDialog:false,
+      checkDisabled:false,
       viewDisabled:false,
       takeDisabled:false,
       form: {},
@@ -712,6 +720,7 @@ export default {
     })
     if(this.detailData.view){
       this.viewDisabled = true
+      this.checkDisabled = true
     }
     if (this.detailData.id) {
       this.buttonLoading = true;
@@ -732,6 +741,7 @@ export default {
     //编辑按钮
     openDisabled(){
       this.viewDisabled = false
+      this.checkDisabled = false
     },
     valueName(value,row){
       this.$set(row,"priceCategory",value.id)
@@ -856,6 +866,35 @@ export default {
         this.afterEcho(res.data.data)
       })
     },
+    //请核
+    auditCheck(){
+      if(this.verificationData()){
+        this.$confirm("确定审核此订单?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(()=>{
+          this.buttonLoading = true
+          const data = {
+            id : this.form.id,
+            checkType: 'cgqh',
+            url: '/purchase/contract/index',
+            pageStatus:"this.$store.getters.importCGStatus",
+            pageLabel:"采购订单(I)",
+            checkFlag: 1,
+          }
+
+          pleaseCheck(data).then(res=>{
+            if(res.data.success){
+              this.$message.success("操作成功!")
+              this.viewDisabled = true
+            }
+          })
+        }).finally(()=>{
+          this.buttonLoading = false
+        })
+      }
+    },
     //财务操作
     applySettlement(type){
       if(this.verificationData()){

+ 3 - 0
src/views/workManagement/main-items/configuration/mainList.json

@@ -83,6 +83,9 @@
     {
       "label": "结算日期",
       "prop": "payTime",
+      "type": "date",
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
       "index": 9,
       "width": 150,
       "overHidden": true

+ 28 - 6
src/views/workManagement/main-items/detailsPage.vue

@@ -37,9 +37,12 @@
 <!--              </el-dropdown-item>-->
 <!--            </el-dropdown-menu>-->
 <!--          </el-dropdown>-->
-
-          <el-button class="el-button--small-yh "
-                     type="primary"
+          <el-button type="primary"
+                     size="small"
+                     :disabled="buttonLoading"
+                     @click="postMessage">发送消息
+          </el-button>
+          <el-button type="primary"
                      :loading="buttonLoading"
                      @click.stop="editMainProject"
                      size="small"
@@ -273,6 +276,12 @@
         ></avue-crud>
       </basic-container>
     </div>
+
+    <messagePost
+      v-if="messageVisble"
+      ref="messagePost"
+      @closeDialog="closeDialog"
+    ></messagePost>
     <el-dialog
       title="导入服务项目"
       append-to-body
@@ -420,6 +429,7 @@
   import optionAdd from "../receipt/configuration/settleAccountsDetailsADD.json";
   import optionReturn from "../receipt/configuration/settleAccountsDetailsReturn.json";
   import { getDeptTree } from "@/api/system/dept";
+  import messagePost from "@/components/messageSend/main"
 
 
   export default {
@@ -428,6 +438,10 @@
         type: Object
       }
     },
+    components:{
+      examineApprove,
+      messagePost
+    },
     data() {
       return {
         id:'',
@@ -443,6 +457,7 @@
         salesNameDic:[],
         sourceBusinessDic:[],
         buttonLoading:false,
+        messageVisble:false,
         viewDisabled:false,
         deptDicData:[],//任务部门数据
         serviceDialog:false,//服务导入窗口
@@ -807,9 +822,6 @@
         })
       }
     },
-    components:{
-      examineApprove
-    },
     mounted() {
 
     },
@@ -1010,6 +1022,16 @@
         }
         //
       },
+      // 发送消息
+      postMessage() {
+        this.messageVisble = true
+        this.$nextTick(() => {
+          this.$refs.messagePost.init()
+        })
+      },
+      closeDialog() {
+        this.messageVisble = false
+      },
       getProjectDetail(){
         projectDetail(this.id,"0,1,2,3,4,5").then(res =>{
           this.afterEcho(res.data.data)