Browse Source

预开票

sangwenwei 1 năm trước cách đây
mục cha
commit
9fcc46b66a

+ 7 - 0
src/api/sys/ReimbursementService.js

@@ -51,6 +51,13 @@ export default class ReimbursementService {
       params: {name: name}
     })
   }
+	userTree2 (name) {
+		return request({
+			url: prefix + '/reimbursement/info/userTree2',
+			method: 'get',
+			params: {name: name}
+		})
+	}
   exportFile (params) {
     return request({
       url: prefix + '/reimbursement/info/exportFile',

+ 30 - 9
src/views/cw/invoice/InvoiceFormTask.vue

@@ -354,7 +354,7 @@
 			  </el-form-item>
 		  </el-col>
 
-		  <el-form v-if="status === 'audit' || status === 'taskFormDetail'" :disabled="status === 'taskFormDetail'" style="width: 100%" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"
+		  <el-form v-if="status === 'audit' || status === 'taskFormDetail'" :disabled="status === 'taskFormDetail' || isDisabled" style="width: 100%" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"
 				   label-width="160px" @submit.native.prevent>
 			  <el-row :gutter="15">
 			  <el-col :span="12" >
@@ -547,7 +547,7 @@
       </el-row>
 
 
-      <el-form :disabled="status === 'audit'?false:true">
+      <el-form :disabled="status === 'taskFormDetail'|| isDisabled">
         <el-divider content-position="left"><i class="el-icon-document"></i>
           发票明细
           <el-button style="margin-left: 20px" type="primary" :disabled="status === 'audit'?false:true" @click="insertEvent('detail')" plain>
@@ -610,12 +610,13 @@
 			  >
 				  <vxe-table-column field="code" title="发票代码" :edit-render="{}">
 					  <template #edit="scope">
-						  <el-input v-model="scope.row.code" placeholder="请填写发票代码"/>
+						  <el-input :disabled="isDisabled" v-model="scope.row.code" placeholder="请填写发票代码"/>
 					  </template>
 				  </vxe-table-column>
 				  <vxe-table-column field="number" title="发票号" :edit-render="{}">
 					  <template #edit="scope">
 						  <el-input
+							  :disabled="isDisabled"
 							  oninput ="value=value.replace(/\D|^/g,'')"
 							  placeholder="请填写发票号"
 							  maxlength="8"
@@ -628,6 +629,7 @@
 				  <vxe-table-column field="account" title="开票金额(元)" :edit-render="{}">
 					  <template #edit="scope">
 						  <el-input-number
+							  :disabled="isDisabled"
 							  @blur="checkAccount(scope.row,scope.$rowIndex)"
 							  v-model="scope.row.account"
 							  controls-position="right"
@@ -644,6 +646,7 @@
 				  <vxe-table-column field="rate" title="税率(%)" :edit-render="{}">
 					  <template #edit="scope">
 						  <el-input-number
+							  :disabled="isDisabled"
 							  @blur="checkRate(scope.row, scope.$rowIndex)"
 							  v-model="scope.row.rate"
 							  controls-position="right"
@@ -659,17 +662,18 @@
 				  </vxe-table-column>
 				  <vxe-table-column field="amount" title="金额" :edit-render="{}">
 					  <template #edit="scope">
-						  <el-input :readonly="true" v-model="scope.row.amount" placeholder="请填写金额"/>
+						  <el-input :disabled="isDisabled" :readonly="true" v-model="scope.row.amount" placeholder="请填写金额"/>
 					  </template>
 				  </vxe-table-column>
 				  <vxe-table-column field="tax" title="税额" :edit-render="{}">
 					  <template #edit="scope">
-						  <el-input :readonly="true" v-model="scope.row.tax" placeholder="请填写税额"/>
+						  <el-input :disabled="isDisabled" :readonly="true" v-model="scope.row.tax" placeholder="请填写税额"/>
 					  </template>
 				  </vxe-table-column>
 				  <vxe-table-column field="allAmount" title="累计登记金额" :edit-render="{}">
 					  <template #edit="scope">
 						  <el-input-number
+							  :disabled="isDisabled"
 							  v-model="scope.row.allAmount"
 							  controls-position="right"
 							  :controls="false"
@@ -684,7 +688,7 @@
 				  </vxe-table-column>
 				  <vxe-table-column title="操作" width="100">
 					  <template v-slot="scope">
-						  <el-button type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'detail')">删除</el-button>
+						  <el-button :disabled="isDisabled" type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'detail')">删除</el-button>
 					  </template>
 				  </vxe-table-column>
 			  </vxe-table>
@@ -912,7 +916,8 @@
 			  userName: this.$store.state.user.name,
 			  userEmail: '',
 			  userPhone: '',
-			  isPreInvoice:''
+			  isPreInvoice:'',
+			  isDisabled: false
 		  }
 	  },
 	  commonApi: null,
@@ -1046,9 +1051,13 @@
 				  financeInvoiceService.queryById(this.inputForm.id).then((data) => {
 					  this.$refs.uploadComponent.clearUpload()
 					  this.inputForm = this.recover(this.inputForm, data)
+					  console.log('data',data)
 					  if (this.commonJS.isEmpty(this.inputForm.actualDrawerEmailAddress)) {
 						  this.inputForm.actualDrawerEmailAddress = this.userEmail
 					  }
+					  if (this.commonJS.isNotEmpty(data.isPreInvoice)){
+					  	this.isPreInvoice = data.isPreInvoice
+					  }
 					  this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
 					  if (!this.commonJS.isEmpty(this.inputForm.billingWorkplaceRealId)) {
 						  this.bankList = []
@@ -1111,6 +1120,15 @@
 							  this.inputForm.billingDate = this.moment(new Date()).format('YYYY-MM-DD')
 						  }
 					  }
+					  //判断当前审核节点是哪个节点
+					  this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then((data) => {
+						  if (this.commonJS.isNotEmpty(data)) {
+							  if (data === '所长审批') {
+									this.isDisabled = true
+							  }
+						  }
+					  })
+
 					  /*if (this.commonJS.isEmpty(this.inputForm.billingDate)) {
 						  this.inputForm.billingDate = this.moment(new Date()).format('YYYY-MM-DD')
 					  }*/
@@ -1349,10 +1367,13 @@
 
 					  //验证邮箱
 				      this.checkEmail()
-
 					  financeInvoiceService.saveForm(this.inputForm).then((data) => {
 						  if (status === 'start' || status === 'reapply') {
-							  this.inputForm.title = `${this.$store.state.user.name} 发起了 ${data.no} [财务-发票申请]`
+							  if (this.commonJS.isNotEmpty(this.isPreInvoice) && this.isPreInvoice === '1'){
+								  this.inputForm.title = `${this.$store.state.user.name} 发起了 ${data.no} [财务-预开票申请]`
+							  }else {
+								  this.inputForm.title = `${this.$store.state.user.name} 发起了 ${data.no} [财务-发票申请]`
+							  }
 						  }
 						  this.inputForm.id = data.businessId
 						  console.log('data22', data)

+ 2 - 1
src/views/cw/invoice/InvoiceList.vue

@@ -656,6 +656,7 @@
 		  } else if (row.status === '4') {
 			  status = 'reapplyFlag'
 		  }
+		  console.log('row',row)
       	if (this.commonJS.isNotEmpty(row.isPreInvoice) && row.isPreInvoice === '1'){
 			taskService.getTaskDef({ procDefId: this.processDefinitionIdPreInvoice,
 				businessId: row.id,
@@ -670,7 +671,7 @@
 						formType: data.formType,
 						formUrl: data.formUrl,
 						formTitle: processTitle,
-						businessTable: 'finance_invoice',
+						businessTable: 'cw_finance_invoice',
 						businessId: row.id,
 						isShow: 'false',
 						status: status,

+ 2 - 2
src/views/cw/projectRecords/ProjectRecordsAddForm.vue

@@ -470,8 +470,8 @@
   import projectReportService from "@/api/cw/reportManagement/ProjectReportService";
   import cwFinanceInvoiceService from "@/api/cw/invoice/CwFinanceInvoiceService";
   import UserSelect1 from '@/views/utils/UserTreeSelect'
-  import UserSelect2 from '@/views/utils/UserTreeSelect'
-  import UserSelect3 from '@/views/utils/UserTreeSelect'
+  import UserSelect2 from '@/views/utils/UserTreeSelect2'
+  import UserSelect3 from '@/views/utils/UserTreeSelect2'
   export default {
     props: {
       businessId: {

+ 2 - 2
src/views/cw/projectRecords/ProjectRecordsList.vue

@@ -191,8 +191,8 @@
   import ContractNameForm from '../workContract/ContractNameForm'
   import ProjectRecordsAddForm from './ProjectRecordsAddForm'
   import SelectTree from '@/components/treeSelect/treeSelect.vue'
-	import UserSelect1 from '@/views/utils/UserTreeSelect'
-	import UserSelect2 from '@/views/utils/UserTreeSelect'
+	import UserSelect1 from '@/views/utils/UserTreeSelect2'
+	import UserSelect2 from '@/views/utils/UserTreeSelect2'
 	import UserSelect3 from '@/views/utils/UserTreeSelect'
 	export default {
     data () {

+ 9 - 8
src/views/cw/reportManagement/ReportReviewTakeNumberForm.vue

@@ -191,7 +191,7 @@
 							<el-form-item label="开票编号" prop="invoiceNumber"
 										  :rules="[{required: true, message:'开票编号不能为空', trigger:'change'}
                    ]">
-								<el-input v-if="preInvoice" @focus="openInoviceForm()" :disabled="status === 'audit' || status === 'taskFormDetail'"  v-model="inputForm.invoiceNumber" placeholder="请填写开票编号" clearable></el-input>
+								<el-input v-if="preInvoice" @focus="openInoviceForm()" :disabled="status === 'audit' || status === 'taskFormDetail' ||this.inputForm.isCompleteInvoice === '1'"  v-model="inputForm.invoiceNumber" placeholder="请填写开票编号" clearable></el-input>
 							</el-form-item>
 						</el-col>
 
@@ -487,7 +487,7 @@
 		<user-select2 ref="userSelect2" @doSubmit="selectUser2"></user-select2>
 		<user-select3 ref="userSelect3" @doSubmit="selectUser3"></user-select3>
 		<!--    <ReportCancellApplyChooseCom  ref="reportCancellApplyChooseCom" @getProject="getContract"></ReportCancellApplyChooseCom>-->
-		<el-dialog v-model="visible" title="Warning" width="300" center>
+		<el-dialog v-model="visible" title="提示" width="400" center>
     <span>
       该项目是否已完成预开票关联
     </span>
@@ -778,7 +778,8 @@
 					takeNumberType:'',
 					improperTakeCause: '',
 					businessObjects: '',
-					invoiceNumber:''
+					invoiceNumber:'',
+					isCompleteInvoice: ''
 				}
 				this.inputForm.id = id
 				this.loading = false
@@ -890,10 +891,6 @@
 							throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
 						} else {
 							this.checkTotal()
-							setTimeout(()=>{
-								this.doSubmit('start', callback)
-							},5000)
-
 						}
 					})
 				} else {
@@ -1181,6 +1178,8 @@
 				this.inputForm.cwProjectInfoList = []
 				//校验当前项目是否预开票及项目下是否存在已开票信息
 				this.checkIsPreInvoice()
+				//查询该项目下的报告是否已完成关联
+				// projectReportService.
 			},
 			openWorkClient () {
 				this.$refs.reportServiceUnitForm.init(this.inputForm.projectId)
@@ -1283,7 +1282,7 @@
 				this.$refs.financeInvoiceRadioForm.init(this.inputForm.projectId)
 			},
 			getInvoice(row,total){
-				this.inputForm.invoiceNumber = row.number
+				this.inputForm.invoiceNumber = row.no
 				this.invoiceTotal = total
 				console.log('total',this.invoiceTotal)
 			},
@@ -1291,11 +1290,13 @@
 				this.inputForm.isCompleteInvoice = '0'
 				this.visible = false
 				this.loading = false
+				this.doSubmit('start', callback)
 			},
 			complete(){
 				this.inputForm.isCompleteInvoice = '1'
 				this.visible = false
 				this.loading = false
+				this.doSubmit('start', callback)
 			},
 			checkTotal(){
 				if(this.invoiceTotal === 1 || this.total === 0){

+ 24 - 1
src/views/program/registered/ProjectList.vue

@@ -1733,7 +1733,30 @@
 		rnew (row) {
       		this.programProjectListInfoService.getIsUsed(row.reportNo).then((data)=>{
       			console.log('data',data)
-      			if (data === true){
+      			if (data){
+      				this.$confirm('报告号'+row.reportNo+'已经被使用,若恢复则会生成新的报告号,是否继续恢复','提示',{
+						confirmButtonText: '确定',
+						cancelButtonText: '取消',
+						type: 'warning'
+					}).then(async ()=>{
+						this.$confirm(`确定要恢复该项目吗?`, '提示', {
+							confirmButtonText: '确定',
+							cancelButtonText: '取消',
+							type: 'warning'
+						}).then(async () => {
+							await this.programProjectListInfoService.queryById(row.cancellId).then((data) => {
+								if (data.cancellationStatus !== '5') { // status的值不等于“审核中”,就弹出提示
+									this.$message.error('数据已发生改变或不存在,请刷新数据')
+									this.refreshList()
+								} else {
+									let form = {cancellationStatus: '0', cancellId: row.cancellId}
+									this.programProjectListInfoService.updateStatusByCancellId(form)
+									this.dialogVisible = false
+									this.refreshList()
+								}
+							})
+						})
+					})
       				this.usedNo = row
       				this.dialogVisible = true
 				}else {

+ 142 - 0
src/views/utils/UserTreeSelect2.vue

@@ -0,0 +1,142 @@
+<template>
+  <div>
+    <el-dialog
+      :title="title"
+      :close-on-click-modal="false"
+	  draggable
+      width="500px"
+      height="700px"
+      @close="close"
+      append-to-body
+	  v-model="visible">
+      <div style="height: calc(100% - 80px);">
+        <el-form :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+          <!-- 搜索框-->
+          <el-form-item label="" prop="name">
+            <el-input v-model="searchForm.name" placeholder="请输入用户名称" clearable></el-input>
+          </el-form-item>
+
+          <el-form-item>
+            <el-button type="primary" @click="list()" size="medium" icon="el-icon-search">查询</el-button>
+            <el-button @click="resetSearch()" size="medium" icon="el-icon-refresh-right">重置</el-button>
+          </el-form-item>
+        </el-form>
+        <vxe-table
+          border="inner"
+          auto-resize
+          resizable
+          height="400px"
+          :loading="loading"
+          size="small"
+          ref="userTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          :sort-config="{remote:true}"
+          :data="dataList"
+          :row-config="{isCurrent: true}"
+          :radio-config="{trigger: 'row'}"
+          :tree-config="{transform: true, rowField: 'id', parentField: 'parentId',expandAll: true}"
+          :checkbox-config="{}">
+<!--          <vxe-column type="seq" width="60" title="序号"></vxe-column>-->
+          <vxe-column type="radio" width="50" ></vxe-column>
+
+          <vxe-column title="姓名" min-width="180" field="name" align="left" tree-node></vxe-column>
+        </vxe-table>
+      </div>
+		<template #footer>
+			<span class="dialog-footer">
+			  <el-button @click="close()" size="medium" icon="el-icon-circle-close">关闭</el-button>
+			  <el-button type="primary" size="medium" v-if="method != 'view'" @click="getProgramForUser()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+			</span>
+		</template>
+
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import ReimbursementService from '@/api/sys/ReimbursementService'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        dataList: [],
+        searchForm: {
+          name: ''
+        }
+      }
+    },
+    reimbursementService: null,
+    created () {
+      this.reimbursementService = new ReimbursementService()
+    },
+    components: {
+    },
+    methods: {
+      init () {
+        this.title = '人员选择'
+        this.visible = true
+        this.list()
+      },
+      // 表单提交
+      getProgramForUser () {
+        let rows = []
+        if (this.commonJS.isEmpty(this.$refs.userTable.getRadioRecord())) {
+          this.$message.error('请选择一条数据')
+          return
+        }
+        // if (this.$refs.userTable.getCheckboxRecords().length > 1) {
+        //   this.$message.error('最多选择一条数据')
+        //   return
+        // }
+        let row = this.$refs.userTable.getRadioRecord()
+        if (!row.isUser) {
+          this.$message.error('请选择子集数据')
+          return
+        }
+        this.close()
+        rows.push(row)
+        this.$emit('doSubmit', rows)
+      },
+      list () {
+        this.loading = true
+        this.reimbursementService.userTree2(this.searchForm.name).then((data) => {
+          this.dataList = data
+          this.loading = false
+          this.$nextTick(() => {
+            this.$refs.userTable.setAllTreeExpand(true)
+          })
+        })
+      },
+      // 当前页
+      currentChangeHandle ({currentPage, pageSize}) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.list()
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.list()
+      },
+      close () {
+        this.detail = ''
+        this.visible = false
+      }
+    }
+  }
+</script>
+<style>
+  .messageZindex {
+    z-index:9999 !important;
+  }
+</style>
+<style scoped>
+  /deep/ .el-dialog__body {
+    padding-top: 0px;
+  }
+</style>