浏览代码

Merge branch 'develop_yh10' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh10

lilei 2 年之前
父节点
当前提交
d84e0a7608

+ 11 - 0
src/api/financeBook.js

@@ -162,3 +162,14 @@ export const financeBookDetailDelete = (params) => {
     method: 'post'
   })
 }
+
+//修改开票日期
+export const updateDetailInvoiceDate = (params) => {
+  const url = `/financeBook/detail/updateDetailInvoiceDate`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+

+ 172 - 0
src/views/financialManagement/collectionDetailStatic/invoiceModal.vue

@@ -0,0 +1,172 @@
+<template>
+  <a-modal v-model="opened" :title="title" centered :maskClosable="false" :footer="null" @cancel="cancel" width="50%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model id="chooseCustom-form" ref="ruleForm" :model="form"
+        :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+        <a-form-model-item label="收款单号:" prop="no"> <span>{{form.no}}</span>
+        </a-form-model-item>
+        <a-form-model-item label="付款方:" prop="payerName"> <span>{{form.payerName}}</span>
+        </a-form-model-item>
+        <a-form-model-item label="开票日期:" prop="invoiceDate">
+         <a-date-picker
+           show-time
+           id="noticeEdit-releaseDate"
+           format="YYYY-MM-DD HH:mm:ss"
+           placeholder="请选择开票时间"
+           :disabled-date="disabledDate"
+           :disabledTime="disabledDateTime"
+           v-model="form.invoiceDate"/>
+           <span style="color:#999">如果没有开票,则不填写即可</span>
+        </a-form-model-item>
+        <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;margin-top: 50px;">
+          <a-button @click="cancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
+          <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">确定
+          </a-button>
+        </a-form-model-item>
+      </a-form-model>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+  import moment from 'moment'
+  import {
+    updateDetailInvoiceDate
+  } from '@/api/financeBook.js'
+  export default {
+    name: 'InvoiceModal',
+    props: {
+      show: [Boolean],
+      info: {
+        type: Object,
+        default: () => {
+          return null
+        }
+      }
+    },
+    data() {
+      return {
+        opened: this.show,
+        spinning: false,
+        title: '开票日期',
+
+        confirmLoading: false,
+        formItemLayout: {
+          labelCol: {
+            span: 6
+          },
+          wrapperCol: {
+            span: 18
+          }
+        },
+        form: {
+          no: undefined,
+          payerName: undefined,
+          invoiceDate:undefined,
+          bookDetailSn:''
+        }
+      }
+    },
+    methods: {
+     disabledDate (current) {
+       return current && current < moment().startOf('day')
+     },
+     disabledDateTime (date) {
+       if (!date) {
+         date = moment()
+       }
+       return {
+         disabledHours: () => this.getDisabledHours(date.format('YYYY-MM-DD HH:mm:ss')),
+         disabledMinutes: () => this.getDisabledMinutes(date.format('YYYY-MM-DD HH:mm:ss')),
+         disabledSeconds: () => this.getDisabledSeconds(date.format('YYYY-MM-DD HH:mm:ss'))
+       }
+     },
+     // 禁用时间范围  时
+     getDisabledHours (nowTime) {
+       const todayDate = moment().format('YYYY-MM-DD HH:mm:ss')
+       const time = nowTime.split(' ')
+       const times = todayDate.split(' ')
+       const timeArrs = times[1].split(':')
+       const hours = []
+       if (todayDate.split(' ')[0] == time[0]) {
+         for (var i = 0; i < parseInt(timeArrs[0]); i++) {
+           hours.push(i)
+         }
+       }
+       return hours
+     },
+     // 禁用时间范围  分
+     getDisabledMinutes (nowTime) {
+       const todayDate = moment().format('YYYY-MM-DD HH:mm:ss')
+       const time = nowTime.split(' ')
+       const times = todayDate.split(' ')
+       const timeArr = time[1].split(':')
+       const timeArrs = times[1].split(':')
+       const minutes = []
+       if (todayDate.split(' ')[0] == time[0] && timeArrs[0] == timeArr[0]) {
+         for (var i = 0; i < parseInt(timeArrs[1]); i++) {
+           minutes.push(i)
+         }
+       }
+       return minutes
+     },
+     // 禁用时间范围  秒
+     getDisabledSeconds (nowTime) {
+       const todayDate = moment().format('YYYY-MM-DD HH:mm:ss')
+       const time = nowTime.split(' ')
+       const times = todayDate.split(' ')
+       const timeArr = time[1].split(':')
+       const timeArrs = times[1].split(':')
+       const second = []
+       if (todayDate.split(' ')[0] == time[0] && timeArrs[0] == timeArr[0] && timeArrs[1] == timeArr[1]) {
+         for (var i = 0; i <= parseInt(timeArrs[2]); i++) {
+           second.push(i)
+         }
+       }
+       return second
+     },
+      //  保存
+      handleSubmit(e) {
+        e.preventDefault()
+        const _this = this
+        this.$refs.ruleForm.validate(valid => {
+          if (valid) {
+            _this.salesSaveFun()
+          } else {
+            return false
+          }
+        })
+      },
+      salesSaveFun() {
+        const _this = this
+        const ajax_form = {
+          "bookDetailSn" :this.form.bookDetailSn,
+          "invoiceDate": this.form.invoiceDate
+        }
+        _this.spinning = true
+        updateDetailInvoiceDate(ajax_form).then(res => {
+          if (res.status == 200) {
+            _this.$message.success(res.message)
+            _this.cancel()
+            _this.spinning = false
+          } else {
+            _this.spinning = false
+          }
+        })
+      },
+      cancel() {
+        this.opened = false
+        this.$emit('cancel')
+        this.$refs.ruleForm.resetFields()
+      }
+    },
+    watch: {
+      show(newValue, oldValue) {
+        this.opened = newValue
+        if (!newValue) {
+          this.infoObj = this.info
+        } 
+      }
+    }
+  }
+</script>

+ 37 - 16
src/views/financialManagement/collectionDetailStatic/list.vue

@@ -42,7 +42,7 @@
               </a-form-item>
             </a-col>
             <template v-if="advanced">
-              <a-col :md="4" :sm="24">
+              <a-col :md="6" :sm="24">
                 <a-form-item label="足额打款">
                   <v-select
                     v-model="queryParam.fullPaymentFlag"
@@ -72,13 +72,14 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="开票状态">
-                  <v-select
-                    v-model="queryParam.invoiceDateType"
-                    ref="invoiceDateType"
-                    id="collectionDetail-invoiceDateType"
-                    code="FLAG"
-                    placeholder="请选择开票状态"
-                    allowClear></v-select>
+                  <a-select v-model="queryParam.invoiceDateType" style="width: 100%" placeholder="请选择开票状态">
+                        <a-select-option value="1">
+                          已开票
+                        </a-select-option>
+                        <a-select-option value="0">
+                         未开票
+                        </a-select-option>
+                      </a-select>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -86,7 +87,7 @@
                  <rangeDate ref="receiptDate" :value="receiptDate" @change="receiptDateChange" />
                </a-form-item>
               </a-col>
-              <a-col :md="4" :sm="24">
+              <a-col :md="6" :sm="24">
                 <a-form-item label="所属区域">
                   <subarea id="collectionDetail-subarea" v-model="queryParam.subareaSn"></subarea>
                 </a-form-item>
@@ -140,11 +141,15 @@
         bordered>
         <!-- 开票日期 -->
         <template slot="draftDate" slot-scope="text, record">
-          <span v-if="$hasPermissions('B_fc_detail')" class="link-bule" @click="handleDetail(record)">{{ record.bookNo }}</span>
-          <span v-else>{{ record.bookNo }}</span>
+          <div  @click="handleInvoice(record)">
+            <span v-if="record.invoiceBeginDate" class="link-bule">{{ record.invoiceBeginDate }}~{{record.invoiceEndDate}}</span>
+            <span class="link-bule" v-else>--</span>
+          </div>
         </template>
       </s-table>
     </a-spin>
+    <!-- 开票日期弹窗 -->
+     <invoiceModal v-drag :show="invoiceIsShow" :info="invoiceInfo" @cancel="invoiceIsShow=false"></invoiceModal>
   </a-card>
 </template>
 
@@ -158,11 +163,12 @@ import Area from '@/views/common/area.js'
 import { hdExportExcel } from '@/libs/exportExcel'
 import employee from '../../expenseManagement/expenseReimbursement/employee.js'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import invoiceModal from './invoiceModal.vue'
 import { financeBookDetailQueryPage, financeBookDetailExport, financeBookReportDetailCount } from '@/api/financeBook.js'
 export default {
   name: 'CollectionDetailStaticList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, employee, dealerSubareaScopeList, subarea, Area },
+  components: { STable, VSelect, rangeDate, employee, dealerSubareaScopeList, subarea, Area,invoiceModal },
   data () {
     return {
       spinning: false,
@@ -182,8 +188,10 @@ export default {
         bankAccount: undefined,
         bankName: undefined,
         subareaSn: undefined,
-        provinceSn: undefined
+        provinceSn: undefined,
+        invoiceDateType:undefined
       },
+      invoiceIsShow:false,
       disabled: false, //  查询、重置按钮是否可操作
       receiptDate: [], //  收款时间
       auditDate: [
@@ -232,7 +240,8 @@ export default {
           bankName: ['九江银行']
         }
       ],
-      bankNameList: []
+      bankNameList: [],
+      invoiceInfo:null
     }
   },
   // 根据权限显示列表字段
@@ -257,8 +266,8 @@ export default {
         { title: '跨月打款', dataIndex: 'nextMonthAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
         { title: '户名', dataIndex: 'bankAccount', align: 'center', width: '5%', customRender: function (text) { return text || '--' } },
         { title: '汇入银行', dataIndex: 'bankName', align: 'center', width: '5%', customRender: function (text) { return text || '--' } },
-        { title: '足额打款', dataIndex: 'fullPaymentFlagDictValue', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
-        { title: '开票日期', scopedSlots: { customRender: 'draftDate' },align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
+        { title: '足额打款', dataIndex: 'fullPaymentFlagDictValue', align: 'center', width: '5%',customRender: function (text) { return (text == 0 || text) ? text : '--' }},
+        { title: '开票日期', scopedSlots: { customRender: 'draftDate' },align: 'center', width: '8%'},
         { title: '备注', dataIndex: 'remarks', align: 'center', width: '8%', customRender: function (text) { return text || '--' }, ellipsis: true }
       ]
       return arr
@@ -315,6 +324,7 @@ export default {
       this.queryParam.bankAccount = undefined
       this.queryParam.subareaSn = undefined
       this.queryParam.provinceSn = undefined
+      this.queryParam.invoiceDateType = undefined
       this.$refs.table.refresh(true)
     },
     //  导出
@@ -336,6 +346,17 @@ export default {
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 205
+    },
+    handleInvoice(con){
+      let obj={
+        no:con.bookNo,
+        payerName:con.dealerName,
+        bookDetailSn:con.bookDetailSn
+      }
+      this.invoiceInfo=obj;
+      this.$nextTick(()=>{
+         this.invoiceIsShow = true
+      })
     }
   },
   watch: {

+ 3 - 1
src/views/financialManagement/financialCollection/fcDetailModal.vue

@@ -252,7 +252,7 @@ export default {
         nextMonthAmount: '',
         bankAccount: undefined,
         bankName: undefined,
-        fullPaymentFlag: undefined,
+        fullPaymentFlag: '1',
         remarks: ''
       },
       rules: {
@@ -351,6 +351,8 @@ export default {
     },
     //  保存
     handleSubmit (e) {
+      
+      debugger
       e.preventDefault()
       const _this = this
       this.$refs.ruleForm.validate(valid => {