瀏覽代碼

会计-发票管理:电话号码调整

lizhenhao 2 年之前
父節點
當前提交
2f8d750233

+ 7 - 0
src/api/cw/workClientInfo/WorkClientService.js

@@ -142,4 +142,11 @@ export default class WorkClientService {
       params: params
     })
   }
+  getBillingListByClientId (params) {
+    return request({
+      url: '/cw_work_client/info/getBillingListByClientId',
+      method: 'get',
+      params: params
+    })
+  }
 }

+ 3 - 2
src/views/modules/cw/invoice/InvoiceForm.vue

@@ -270,7 +270,7 @@
                           :rules="[
                         {required: true, message:'是否多张开票不能为空', trigger:'blur'}
                ]">
-              <el-radio v-model="inputForm.isMultiple" v-for="item in $dictUtils.getDictList('yes_no')" :label="item.value" size="small" style="margin-right: 20px">
+              <el-radio v-model="inputForm.isMultiple" v-for="item in yesNoFlag" :label="item.value" size="small" style="margin-right: 20px">
                 {{item.label}}</el-radio>
             </el-form-item>
           </el-col>
@@ -657,7 +657,8 @@
         err: '',
         receivablesFlag: '', // true为收款,false为非收款
         detailFlag: '', // true为修改发票明细
-        importVisible: false
+        importVisible: false,
+        yesNoFlag: [{label: '否', value: '0'}, {label: '是', value: '1'}]
       }
     },
     financeInvoiceService: null,

+ 67 - 15
src/views/modules/cw/invoice/InvoiceFormTask.vue

@@ -135,7 +135,9 @@
                           :rules="[
                       {required: true, message:'电话不能为空', trigger:'blur'},{required: true, message:'电话不能为空', trigger:'change'}
              ]">
-              <el-input v-model="inputForm.telPhone" placeholder="请填写电话"clearable></el-input>
+              <el-input v-model="inputForm.telPhone" :readonly="commonJS.isNotEmpty(inputForm.billingId)" placeholder="请填写电话">
+                <el-button slot="append" icon="el-icon-search" @click="openBillingChoose()"></el-button>
+              </el-input>
             </el-form-item>
           </el-col>
           <el-col v-if="inputForm.billingType === '1'" :span="12">
@@ -181,7 +183,9 @@
             <el-form-item label="电话" prop="telPhone"
                           :rules="[
              ]">
-              <el-input v-model="inputForm.telPhone"placeholder="请填写电话"clearable></el-input>
+              <el-input v-model="inputForm.telPhone" :readonly="commonJS.isNotEmpty(inputForm.billingId)" placeholder="请填写电话">
+                <el-button slot="append" icon="el-icon-search" @click="openBillingChoose()"></el-button>
+              </el-input>
             </el-form-item>
           </el-col>
           <el-col v-if="inputForm.billingType === '1'" :span="12">
@@ -260,7 +264,7 @@
                         :rules="[
                         {required: true, message:'是否多张开票不能为空', trigger:'blur'}
                ]">
-            <el-radio v-model="inputForm.isMultiple" v-for="item in $dictUtils.getDictList('yes_no')" :label="item.value" size="small" style="margin-right: 20px">
+            <el-radio v-model="inputForm.isMultiple" v-for="item in yesNoFlag" :label="item.value" size="small" style="margin-right: 20px">
               {{item.label}}
             </el-radio>
           </el-form-item>
@@ -614,6 +618,8 @@
     <ProgramPageForm ref="programPageForm" @getProgram="getProgram"></ProgramPageForm>
     <ContractForm  ref="contractForm" @getContract="getContract"></ContractForm>
     <WorkClientForm  ref="workClientForm" @getWorkClientRadioChoose="getWorkClient"></WorkClientForm>
+    <WorkClientBillingChooseRadio ref="billingChoose" @getBilling="getBilling"></WorkClientBillingChooseRadio>
+
   </div>
 </template>
 
@@ -626,6 +632,8 @@
   import WorkClientForm from '../workClientInfo/WorkClientChooseRadio'
   import SelectUserTree from '@/views/modules/utils/treeUserSelect'
   import SelectTree from '@/components/treeSelect/treeSelect.vue'
+  import WorkClientBillingChooseRadio from '@/views/modules/cw/workClientInfo/WorkClientBillingChooseRadio'
+
   export default {
     props: {
       businessId: {
@@ -685,13 +693,15 @@
           financeInvoiceDetailDTOList: [],
           financeInvoiceReceivablesDTOList: [],
           financeInvoiceInvalidDTO: {},
-          isMultiple: ''
+          isMultiple: '',
+          billingId: ''
         },
         programRow: '',
         bankList: [],
         err: '',
         keyWatch: '',
-        importVisible: false
+        importVisible: false,
+        yesNoFlag: [{label: '否', value: '0'}, {label: '是', value: '1'}]
       }
     },
     financeInvoiceService: null,
@@ -708,7 +718,8 @@
       WorkClientForm,
       SelectUserTree,
       SelectTree,
-      UpLoadComponent
+      UpLoadComponent,
+      WorkClientBillingChooseRadio
     },
     computed: {
       bus: {
@@ -724,10 +735,8 @@
     watch: {
       'keyWatch': {
         handler (newVal) {
-          if (this.bus) {
-            if (this.bus !== 'false') {
-              this.init('', this.bus)
-            }
+          if (this.commonJS.isNotEmpty(this.bus)) {
+            this.init('', this.bus)
           } else {
             this.$nextTick(() => {
               this.$refs.inputForm.resetFields()
@@ -792,7 +801,8 @@
             invoiceId: '',
             remarks: ''
           },
-          isMultiple: ''
+          isMultiple: '',
+          billingId: ''
         }
         // if (method === 'add') {
         //   this.title = `新建发票`
@@ -807,8 +817,8 @@
         this.$nextTick(() => {
           this.$refs.inputForm.resetFields()
           this.loading = true
-          this.financeInvoiceService.queryById(this.inputForm.id).then(async ({data}) => {
-            await this.$refs.uploadComponent.clearUpload()
+          this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
+            this.$refs.uploadComponent.clearUpload()
             this.inputForm = this.recover(this.inputForm, data)
             this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
             if (!this.commonJS.isEmpty(this.inputForm.billingWorkplaceRealId)) {
@@ -824,6 +834,26 @@
                 }
               })
             }
+
+            if (this.commonJS.isEmpty(this.inputForm.type)) {
+              this.inputForm.type = '1'
+            }
+            if (this.commonJS.isEmpty(this.inputForm.billingType)) {
+              this.inputForm.billingType = '1'
+            }
+            if (this.commonJS.isEmpty(this.inputForm.receivablesType)) {
+              this.inputForm.receivablesType = '2'
+            }
+            if (this.commonJS.isEmpty(this.inputForm.billingPeople)) {
+              this.inputForm.billingPeople = JSON.parse(localStorage.getItem('user')).name
+            }
+            if (this.commonJS.isEmpty(this.inputForm.billingPeopleId)) {
+              this.inputForm.billingPeopleId = JSON.parse(localStorage.getItem('user')).id
+            }
+            if (this.commonJS.isEmpty(this.inputForm.billingPeopleReal)) {
+              this.inputForm.billingPeopleReal = JSON.parse(localStorage.getItem('user')).id
+            }
+
             if (this.commonJS.isEmpty(this.inputForm.workAttachmentDtoList) || this.inputForm.workAttachmentDtoList.length === 0) {
               this.inputForm.workAttachmentDtoList = []
             }
@@ -1073,7 +1103,8 @@
           financeInvoiceDetailDTOList: [],
           financeInvoiceReceivablesDTOList: [],
           financeInvoiceInvalidDTO: {},
-          isMultiple: ''
+          isMultiple: '',
+          billingId: ''
         }
         this.bankList = []
         this.visible = false
@@ -1175,6 +1206,7 @@
       changeRadio () {
         this.inputForm.address = ''
         this.inputForm.telPhone = ''
+        this.inputForm.billingId = ''
         this.inputForm.billingWorkplaceReal = ''
         this.inputForm.billingWorkplaceRealId = ''
         this.inputForm.taxpayerIdentificationNo = ''
@@ -1193,7 +1225,9 @@
         this.inputForm.billingWorkplaceRealId = row.id // 实际开票单位id ‘客户id’
         this.inputForm.taxpayerIdentificationNo = this.commonJS.isEmpty(row.uscCode) ? '' : row.uscCode // 纳税人识别号 ‘统一社会信用代码’
         this.inputForm.address = this.commonJS.isEmpty(row.address) ? '' : row.address // 地址
-        this.inputForm.telPhone = this.commonJS.isEmpty(row.mobile) ? '' : row.mobile // 电话
+        // this.inputForm.telPhone = this.commonJS.isEmpty(row.mobile) ? '' : row.mobile // 电话
+        this.inputForm.billingId = '' // 实际开票单位的开票信息id
+        this.inputForm.telPhone = '' // 电话
         row.cwWorkClientBillingDTOList.forEach(item => {
           item.ourBank = item.accountHolder
           this.bankList.push(item)
@@ -1424,6 +1458,24 @@
           })
         }
         this.$message.success('导入完成')
+      },
+      // 打开开票信息选择组件   选择电话号
+      openBillingChoose () {
+        if (this.commonJS.isEmpty(this.inputForm.billingWorkplaceRealId)) {
+          this.$message.error('获取不到“实际开票单位”,请重新填写')
+          return
+        }
+        this.$refs.billingChoose.init(this.inputForm.billingWorkplaceRealId)
+      },
+      // 开票信息选择组件  选择后回调
+      getBilling (row) {
+        if (this.commonJS.isNotEmpty(row.phone)) {
+          this.inputForm.telPhone = row.phone
+          this.inputForm.billingId = row.id
+        } else {
+          this.inputForm.telPhone = ''
+          this.inputForm.billingId = ''
+        }
       }
     }
   }

+ 5 - 6
src/views/modules/cw/invoice/InvoiceFormTaskInvalid.vue

@@ -261,7 +261,7 @@
                         :rules="[
                         {required: true, message:'是否多张开票不能为空', trigger:'blur'}
                ]">
-            <el-radio v-model="inputForm.isMultiple" v-for="item in $dictUtils.getDictList('yes_no')" :label="item.value" size="small" style="margin-right: 20px">
+            <el-radio v-model="inputForm.isMultiple" v-for="item in yesNoFlag" :label="item.value" size="small" style="margin-right: 20px">
               {{item.label}}
             </el-radio>
           </el-form-item>
@@ -631,7 +631,8 @@
         programRow: '',
         bankList: [],
         err: '',
-        keyWatch: ''
+        keyWatch: '',
+        yesNoFlag: [{label: '否', value: '0'}, {label: '是', value: '1'}]
       }
     },
     financeInvoiceService: null,
@@ -664,10 +665,8 @@
     watch: {
       'keyWatch': {
         handler (newVal) {
-          if (this.bus) {
-            if (this.bus !== 'false') {
-              this.init('', this.bus)
-            }
+          if (this.commonJS.isNotEmpty(this.bus)) {
+            this.init('', this.bus)
           } else {
             this.$nextTick(() => {
               this.$refs.inputForm.resetFields()

+ 155 - 0
src/views/modules/cw/workClientInfo/WorkClientBillingChooseRadio.vue

@@ -0,0 +1,155 @@
+<template>
+  <div>
+    <el-dialog
+      :title="title"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      width="1000px"
+      append-to-body
+      height="500px"
+      @close="close"
+      @keyup.enter.native="getBilling"
+      :visible.sync="visibleChoose">
+      <div style="height: calc(100%);">
+        <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @submit.native.prevent>
+          <!-- 搜索框-->
+          <el-form-item label="公司名称" prop="companyName">
+            <el-input size="small" v-model="searchForm.companyName" placeholder="公司名称" clearable></el-input>
+          </el-form-item>
+          <el-form-item label="纳税人识别号" prop="taxpayerIdentificationNo">
+            <el-input size="small" v-model="searchForm.taxpayerIdentificationNo" placeholder="纳税人识别号" clearable></el-input>
+          </el-form-item>
+
+          <el-form-item>
+            <el-button type="primary" @click="list()" size="small" icon="el-icon-search">查询</el-button>
+            <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
+          </el-form-item>
+        </el-form>
+
+        <vxe-table
+          border="inner"
+          auto-resize
+          resizable
+          height="auto"
+          max-height="400"
+          :loading="loading"
+          size="small"
+          ref="billingTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          :print-config="{}"
+          @sort-change=""
+          :sort-config="{remote:true}"
+          :data="dataList"
+          :row-config="{isCurrent: true}"
+          :radio-config="{trigger: 'row'}">
+          <vxe-column type="seq" width="40"></vxe-column>
+          <vxe-column type="radio" width="40px"></vxe-column>
+          <vxe-column min-width="150" title="公司名称" align="center" field="companyName" tree-node></vxe-column>
+<!--          <vxe-column min-width="150" title="是否有纳税人识别号" align="center" field="isTaxpayerIdentificationNo">-->
+<!--            <template slot-scope="scope">-->
+<!--              {{$dictUtils.getDictLabel('yes_no', scope.row.isTaxpayerIdentificationNo, '-')}}-->
+<!--            </template>-->
+<!--          </vxe-column>-->
+<!--          <vxe-column min-width="150" title="纳税人识别号" align="center" field="taxpayerIdentificationNo"></vxe-column>-->
+          <vxe-column min-width="150" title="开户行" align="center" field="accountHolder"></vxe-column>
+          <vxe-column min-width="150" title="银行账号" align="center" field="account"></vxe-column>
+          <vxe-column min-width="150" title="电话" align="center" field="phone"></vxe-column>
+          <vxe-column min-width="150" title="地址" align="center" field="address"></vxe-column>
+        </vxe-table>
+      </div>
+      <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" type="primary" v-if="method != 'view'" @click="getBilling()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import InputNumber from '@/views/modules/sys/workContract/InputNumber.vue'
+  import WorkClientService from '@/api/cw/workClientInfo/WorkClientService'
+  import SelectUserTree from '@/views/modules/utils/treeUserSelect'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visibleChoose: false,
+        loading: false,
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        dataList: [],
+        searchForm: {
+          clientId: '',
+          companyName: '',
+          taxpayerIdentificationNo: ''
+        },
+        clientId: ''
+      }
+    },
+    workClientService: null,
+    created () {
+      this.workClientService = new WorkClientService()
+    },
+    components: {
+      SelectUserTree,
+      InputNumber
+    },
+    methods: {
+      init (id) {
+        this.title = '开票信息选择'
+        this.visibleChoose = true
+        this.clientId = id
+        this.list()
+      },
+      // 表单提交
+      getBilling () {
+        let row = this.$refs.billingTable.getRadioRecord()
+        if (this.commonJS.isEmpty(row)) {
+          this.$message.error('请至少选择一条数据')
+        } else {
+          this.close()
+          this.$emit('getBilling', row)
+        }
+      },
+      list () {
+        this.dataList = []
+        this.loading = true
+        this.searchForm.clientId = this.clientId
+        this.workClientService.getBillingListByClientId(this.searchForm).then(({data}) => {
+          this.dataList = data
+          this.loading = false
+        })
+      },
+      // 当前页
+      currentChangeHandle ({currentPage, pageSize}) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.list()
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.list()
+      },
+      close () {
+        this.$refs.searchForm.resetFields()
+        this.visibleChoose = false
+      }
+    }
+  }
+</script>
+<style scoped>
+  /deep/ .el-dialog__body {
+    padding-top: 0;
+  }
+  /deep/ .el-form-item--mini.el-form-item, .el-form-item--small.el-form-item {
+    margin-bottom: 0px;
+  }
+</style>

+ 3 - 2
src/views/modules/finance/invoice/InvoiceForm.vue

@@ -268,7 +268,7 @@
                           :rules="[
                         {required: true, message:'是否多张开票不能为空', trigger:'blur'}
                ]">
-              <el-radio v-model="inputForm.isMultiple" v-for="item in $dictUtils.getDictList('yes_no')" :label="item.value" size="small" style="margin-right: 20px">
+              <el-radio v-model="inputForm.isMultiple" v-for="item in yesNoFlag" :label="item.value" size="small" style="margin-right: 20px">
                 {{item.label}}</el-radio>
             </el-form-item>
           </el-col>
@@ -655,7 +655,8 @@
         err: '',
         receivablesFlag: '', // true为收款,false为非收款
         detailFlag: '', // true为修改发票明细
-        importVisible: false
+        importVisible: false,
+        yesNoFlag: [{label: '否', value: '0'}, {label: '是', value: '1'}]
       }
     },
     financeInvoiceService: null,

+ 25 - 7
src/views/modules/finance/invoice/InvoiceFormTask.vue

@@ -260,7 +260,7 @@
                         :rules="[
                         {required: true, message:'是否多张开票不能为空', trigger:'blur'}
                ]">
-            <el-radio v-model="inputForm.isMultiple" v-for="item in $dictUtils.getDictList('yes_no')" :label="item.value" size="small" style="margin-right: 20px">
+            <el-radio v-model="inputForm.isMultiple" v-for="item in yesNoFlag" :label="item.value" size="small" style="margin-right: 20px">
               {{item.label}}
             </el-radio>
           </el-form-item>
@@ -675,7 +675,8 @@
         bankList: [],
         err: '',
         keyWatch: '',
-        importVisible: false
+        importVisible: false,
+        yesNoFlag: [{label: '否', value: '0'}, {label: '是', value: '1'}]
       }
     },
     financeInvoiceService: null,
@@ -708,10 +709,8 @@
     watch: {
       'keyWatch': {
         handler (newVal) {
-          if (this.bus) {
-            if (this.bus !== 'false') {
-              this.init('', this.bus)
-            }
+          if (this.commonJS.isNotEmpty(this.bus)) {
+            this.init('', this.bus)
           } else {
             this.$nextTick(() => {
               this.$refs.inputForm.resetFields()
@@ -795,7 +794,6 @@
             await this.$refs.uploadComponent.clearUpload()
             this.inputForm = this.recover(this.inputForm, data)
             this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
-            console.log(this.inputForm)
             if (!this.commonJS.isEmpty(this.inputForm.billingWorkplaceRealId)) {
               this.workClientService.findById(this.inputForm.billingWorkplaceRealId).then((data) => {
                 this.bankList = data.data.workClientBank
@@ -807,6 +805,26 @@
             if (this.commonJS.isEmpty(this.inputForm.financeInvoiceReceivablesDTOList) || this.inputForm.financeInvoiceReceivablesDTOList.length === 0) {
               this.inputForm.financeInvoiceReceivablesDTOList = []
             }
+
+            if (this.commonJS.isEmpty(this.inputForm.type)) {
+              this.inputForm.type = '1'
+            }
+            if (this.commonJS.isEmpty(this.inputForm.billingType)) {
+              this.inputForm.billingType = '1'
+            }
+            if (this.commonJS.isEmpty(this.inputForm.receivablesType)) {
+              this.inputForm.receivablesType = '2'
+            }
+            if (this.commonJS.isEmpty(this.inputForm.billingPeople)) {
+              this.inputForm.billingPeople = JSON.parse(localStorage.getItem('user')).name
+            }
+            if (this.commonJS.isEmpty(this.inputForm.billingPeopleId)) {
+              this.inputForm.billingPeopleId = JSON.parse(localStorage.getItem('user')).id
+            }
+            if (this.commonJS.isEmpty(this.inputForm.billingPeopleReal)) {
+              this.inputForm.billingPeopleReal = JSON.parse(localStorage.getItem('user')).id
+            }
+
             if (this.commonJS.isEmpty(this.inputForm.isMultiple) && this.status !== 'taskFormDetail') {
               // 是否多张开票  默认为 0 否
               this.inputForm.isMultiple = '0'

+ 5 - 6
src/views/modules/finance/invoice/InvoiceFormTaskInvalid.vue

@@ -261,7 +261,7 @@
                         :rules="[
                         {required: true, message:'是否多张开票不能为空', trigger:'blur'}
                ]">
-            <el-radio v-model="inputForm.isMultiple" v-for="item in $dictUtils.getDictList('yes_no')" :label="item.value" size="small" style="margin-right: 20px">
+            <el-radio v-model="inputForm.isMultiple" v-for="item in yesNoFlag" :label="item.value" size="small" style="margin-right: 20px">
               {{item.label}}
             </el-radio>
           </el-form-item>
@@ -631,7 +631,8 @@
         programRow: '',
         bankList: [],
         err: '',
-        keyWatch: ''
+        keyWatch: '',
+        yesNoFlag: [{label: '否', value: '0'}, {label: '是', value: '1'}]
       }
     },
     financeInvoiceService: null,
@@ -663,10 +664,8 @@
     watch: {
       'keyWatch': {
         handler (newVal) {
-          if (this.bus) {
-            if (this.bus !== 'false') {
-              this.init('', this.bus)
-            }
+          if (this.commonJS.isNotEmpty(this.bus)) {
+            this.init('', this.bus)
           } else {
             this.$nextTick(() => {
               this.$refs.inputForm.resetFields()