|
@@ -1,33 +1,38 @@
|
|
|
<template>
|
|
|
- <div class="dailyedit-box">
|
|
|
+ <div v-loading="fullscreenLoading" class="dailyedit-box">
|
|
|
<div class="dailyedit-title">
|
|
|
新增日常费用付款申请款项
|
|
|
</div>
|
|
|
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm">
|
|
|
<div class="dailyedit-set">
|
|
|
- <el-form-item label="费用标识:" label-width="85px" prop="identification">
|
|
|
- <el-select v-model="ruleForm.identification" placeholder="请选择费用标识">
|
|
|
- <el-option v-for="(item,index) in identificationset" :key="index" :label="item.title" :value="item.id"></el-option>
|
|
|
+ <el-form-item label="类型标识:" label-width="85px" prop="transferation">
|
|
|
+ <el-select :disabled="thesame" @change="trans()" v-model="ruleForm.transferation" placeholder="请选择转账标识">
|
|
|
+ <el-option v-for="(item,index) in Transferlogo" :key="index" :label="item.name" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="转账标识:" prop="identification" label-width="85px">
|
|
|
+ <el-select :disabled="banned" v-model="ruleForm.identification" placeholder="请选择费用类型">
|
|
|
+ <el-option v-for="(item,index) in identificationset" :key="index" :label="item.name" :value="item.id"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="费用类型:" prop="type" label-width="85px">
|
|
|
- <el-select v-model="ruleForm.type" placeholder="请选择费用类型">
|
|
|
- <el-option v-for="(item,index) in typeset" :key="index" :label="item.title" :value="item.id"></el-option>
|
|
|
+ <el-select :disabled="thesame" @change="typechange()" v-model="ruleForm.type" placeholder="请选择费用类型">
|
|
|
+ <el-option v-for="(item,index) in typeset" :key="index" :label="item.name" :value="item.id"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="费用名称:" prop="name" label-width="85px">
|
|
|
- <el-select v-model="ruleForm.name" placeholder="请选择费用名称">
|
|
|
- <el-option v-for="(item,index) in nameset" :key="index" :label="item.title" :value="item.id"></el-option>
|
|
|
+ <el-select :disabled="bannedtype" v-model="ruleForm.name" placeholder="请选择费用名称">
|
|
|
+ <el-option v-for="(item,index) in nameset" :key="index" :label="item.name" :value="item.id"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="申请公司:" prop="company" label-width="85px">
|
|
|
- <el-select v-model="ruleForm.company" placeholder="请选择申请公司">
|
|
|
- <el-option v-for="(item,index) in companyset" :key="index" :label="item.title" :value="item.id"></el-option>
|
|
|
+ <el-select :disabled="thesame" v-model="ruleForm.company" placeholder="请选择申请公司">
|
|
|
+ <el-option v-for="(item,index) in companyset" :key="index" :label="item.companyName" :value="item.id"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<el-form-item label="申请说明:" label-width="85px" prop="desc">
|
|
|
- <el-input type="textarea" v-model="ruleForm.desc"></el-input>
|
|
|
+ <el-input :disabled="thesame" type="textarea" v-model="ruleForm.desc"></el-input>
|
|
|
</el-form-item>
|
|
|
<div class="dailyfrom-title">
|
|
|
<div>录入具体费用</div>
|
|
@@ -39,22 +44,21 @@
|
|
|
<div v-for="(item,index) in itemsArr" :key="index" class="items-li">
|
|
|
<el-form :model="item" class="demo-form-inline" label-width="85px">
|
|
|
<el-form-item label="费用项目:">
|
|
|
- <el-input v-model="item.expenseItems" placeholder="费用项目名称"></el-input>
|
|
|
+ <el-input :disabled="thesame" v-model="item.priceName" placeholder="费用项目名称"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="数量:">
|
|
|
<template>
|
|
|
- <el-input-number min="1" v-model="item.num"></el-input-number>
|
|
|
+ <el-input-number :disabled="thesame" :min="1" v-model="item.quantity"></el-input-number>
|
|
|
</template>
|
|
|
- <!-- <el-input v-model="item.num" placeholder="数量"></el-input> -->
|
|
|
</el-form-item>
|
|
|
<el-form-item label="单价(RNB):">
|
|
|
- <el-input-number :controls="false" v-model="item.price" :precision="2"></el-input-number>
|
|
|
- <!-- <el-input v-model="item.price" placeholder="单价">
|
|
|
- <i slot="suffix" style="font-style:normal;margin-right: 10px;">RNB</i>
|
|
|
- </el-input> -->
|
|
|
+ <el-input-number :disabled="thesame" :controls="false" v-model="item.price" :precision="2"></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="小计(RNB):">
|
|
|
+ <div class="sub-box">{{item.itemTotal=(item.quantity*item.price).toFixed(2)}}</div>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="备注:">
|
|
|
- <el-input v-model="item.remark" placeholder="备注"></el-input>
|
|
|
+ <el-input :disabled="thesame" v-model="item.remark" placeholder="备注"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button
|
|
@@ -77,22 +81,34 @@
|
|
|
export default {
|
|
|
data(){
|
|
|
return{
|
|
|
+ editid:'',
|
|
|
+ userid:'',
|
|
|
+ token:'',
|
|
|
+ banned:true,
|
|
|
+ bannedtype:true,
|
|
|
+ thesame:false,//是否能编辑标识
|
|
|
ruleForm: {
|
|
|
+ transferation:'',
|
|
|
identification: '',
|
|
|
type: '',
|
|
|
name: '',
|
|
|
company: '',
|
|
|
desc:''
|
|
|
},
|
|
|
+ SumPrice:0,
|
|
|
itemsArr:[
|
|
|
{
|
|
|
- expenseItems:"",
|
|
|
- num:'',
|
|
|
+ priceName:"",
|
|
|
+ quantity:'',
|
|
|
price:"",
|
|
|
+ itemTotal:'',
|
|
|
remark:""
|
|
|
}
|
|
|
],
|
|
|
rules: {
|
|
|
+ transferation: [
|
|
|
+ { required: true, message: '请选择转账标识', trigger: 'change' }
|
|
|
+ ],
|
|
|
identification: [
|
|
|
{ required: true, message: '请选择费用标识', trigger: 'change' }
|
|
|
],
|
|
@@ -109,82 +125,48 @@ export default {
|
|
|
{ required: true, message: '请填写申请说明', trigger: 'change' }
|
|
|
],
|
|
|
},
|
|
|
- identificationset:[
|
|
|
- {
|
|
|
- id:'0',
|
|
|
- title:'公转'
|
|
|
- },
|
|
|
- {
|
|
|
- id:'1',
|
|
|
- title:'私转'
|
|
|
- },
|
|
|
- {
|
|
|
- id:'2',
|
|
|
- title:'刷卡'
|
|
|
- },
|
|
|
- ],
|
|
|
- typeset:[
|
|
|
- {
|
|
|
- id:'0',
|
|
|
- title:'人员费用'
|
|
|
- },
|
|
|
- {
|
|
|
- id:'1',
|
|
|
- title:'办公费用'
|
|
|
- },
|
|
|
- {
|
|
|
- id:'2',
|
|
|
- title:'销售费用'
|
|
|
- },
|
|
|
- {
|
|
|
- id:'3',
|
|
|
- title:'其他费用'
|
|
|
- },
|
|
|
- {
|
|
|
- id:'4',
|
|
|
- title:'大运会'
|
|
|
- },
|
|
|
- ],
|
|
|
- nameset:[
|
|
|
- {
|
|
|
- id:'0',
|
|
|
- title:'员工工资'
|
|
|
- },
|
|
|
- {
|
|
|
- id:'1',
|
|
|
- title:'员工社保'
|
|
|
- },
|
|
|
- {
|
|
|
- id:'2',
|
|
|
- title:'员工福利'
|
|
|
- },
|
|
|
- ],
|
|
|
- companyset:[
|
|
|
- {
|
|
|
- id:'0',
|
|
|
- title:'成都泛美商务有限公司'
|
|
|
- },
|
|
|
- {
|
|
|
- id:'1',
|
|
|
- title:'四川泛美交流有限公司'
|
|
|
- },
|
|
|
- {
|
|
|
- id:'2',
|
|
|
- title:'成都纽茵教育科技有限公司'
|
|
|
- },
|
|
|
- {
|
|
|
- id:'3',
|
|
|
- title:'成都鸿企中元科技有限公司'
|
|
|
- },
|
|
|
- ],
|
|
|
+ Transferlogo:[],//类型标识
|
|
|
+ feeMarkSubTypeData:[],//转账标识ALL
|
|
|
+ identificationset:[],//转账标识
|
|
|
+ typeset:[],//费用类型
|
|
|
+ feeSubTypeData:[],//费用名称ALL
|
|
|
+ nameset:[],//费用名称
|
|
|
+ companyset:[],//申请公司
|
|
|
+ fullscreenLoading:false,//loading
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
submitForm(formName) {
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- alert('submit!');
|
|
|
console.log(this.itemsArr)
|
|
|
+ for(var g=0;g<this.itemsArr.length;g++){
|
|
|
+ if(this.itemsArr[g].itemTotal!=""&&this.itemsArr[g].price!=0&&this.itemsArr[g].priceName!=""&&this.itemsArr[g].quantity!=""&&this.itemsArr[g].remark!=""){
|
|
|
+ if(!this.thesame){
|
|
|
+ for(var k=0;k<this.itemsArr.length;k++){
|
|
|
+ this.SumPrice+=Number(this.itemsArr[k].itemTotal)
|
|
|
+ }
|
|
|
+ if(this.editid!=undefined){
|
|
|
+ this.UpdateDailyPayment()
|
|
|
+ }else{
|
|
|
+ this.AddDailyPayment()
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '本申请不是您建立的或已被审核,无法修改!',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '请检查录入具体费用是否填写完整!',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
} else {
|
|
|
console.log('error submit!!');
|
|
|
return false;
|
|
@@ -192,16 +174,208 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
resetForm(formName) {
|
|
|
- this.$refs[formName].resetFields();
|
|
|
+ // this.$refs[formName].resetFields();
|
|
|
+ this.$router.push({ path: "/home/DailyFeePayment"});
|
|
|
},
|
|
|
AddForm(){
|
|
|
+ if(this.thesame){
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '本申请不是您建立的或已被审核,无法操作!',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
this.itemsArr.push(
|
|
|
- {expenseItems: '', num: '', price:'', remark: ''}
|
|
|
+ {priceName: '', quantity: '', price:'',itemTotal:'', remark: ''}
|
|
|
)
|
|
|
},
|
|
|
deleteRow(index, rows) {
|
|
|
+ if(this.thesame){
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '本申请不是您建立的或已被审核,无法操作!',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
rows.splice(index, 1);
|
|
|
},
|
|
|
+ getTypeData() {
|
|
|
+ var url = "/api/Financial/PostPageSearchDailyPaymentPriceTypeData"
|
|
|
+ var that = this
|
|
|
+ this.$axios({
|
|
|
+ method: 'post',
|
|
|
+ url: url,
|
|
|
+ headers: {
|
|
|
+ Authorization: 'Bearer ' + that.token
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ portType: 1,
|
|
|
+ }
|
|
|
+ }).then(function (res) {
|
|
|
+ console.log(res)
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ that.Transferlogo=res.data.data.feeMarkTypeData;
|
|
|
+ that.feeMarkSubTypeData=res.data.data.feeMarkSubTypeData;
|
|
|
+ that.typeset=res.data.data.feeTypeData;
|
|
|
+ that.feeSubTypeData=res.data.data.feeSubTypeData;
|
|
|
+ that.companyset=res.data.data.companyNameData;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ trans(){
|
|
|
+ this.identificationset=[];
|
|
|
+ this.ruleForm.identification='';
|
|
|
+ for(var i=0;i<this.feeMarkSubTypeData.length;i++){
|
|
|
+ if(this.feeMarkSubTypeData[i].sTid==this.ruleForm.transferation){
|
|
|
+ this.identificationset.push(this.feeMarkSubTypeData[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(this.identificationset.length==0){
|
|
|
+ this.banned=true;
|
|
|
+ }else{
|
|
|
+ this.banned=false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ typechange(){
|
|
|
+ this.nameset=[];
|
|
|
+ this.ruleForm.name='';
|
|
|
+ console.log(this.feeSubTypeData)
|
|
|
+ for(var i=0;i<this.feeSubTypeData.length;i++){
|
|
|
+ if(this.feeSubTypeData[i].sTid==this.ruleForm.type){
|
|
|
+ this.nameset.push(this.feeSubTypeData[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(this.nameset.length==0){
|
|
|
+ this.bannedtype=true;
|
|
|
+ }else{
|
|
|
+ this.bannedtype=false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ AddDailyPayment(){
|
|
|
+ var url = "/api/Financial/PostAddDailyPayment"
|
|
|
+ var that = this
|
|
|
+ this.$axios({
|
|
|
+ method: 'post',
|
|
|
+ url: url,
|
|
|
+ headers: {
|
|
|
+ Authorization: 'Bearer ' + that.token
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ PortType: 1,
|
|
|
+ UserId:that.userid,
|
|
|
+ Instructions:that.ruleForm.desc,
|
|
|
+ SumPrice:that.SumPrice,
|
|
|
+ TransferTypeId:that.ruleForm.identification,
|
|
|
+ PriceTypeId:that.ruleForm.name,
|
|
|
+ CompanyId:that.ruleForm.company,
|
|
|
+ FeeContents:that.itemsArr
|
|
|
+ }
|
|
|
+ }).then(function (res) {
|
|
|
+ console.log(res)
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ that.$message({
|
|
|
+ message: res.data.msg,
|
|
|
+ type: 'success',
|
|
|
+ offset:50
|
|
|
+ });
|
|
|
+ that.$router.push({ path: "/home/DailyFeePayment"});
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ UpdateDailyPayment(){
|
|
|
+ var url = "/api/Financial/PostEditDailyPayment"
|
|
|
+ var that = this
|
|
|
+ this.$axios({
|
|
|
+ method: 'post',
|
|
|
+ url: url,
|
|
|
+ headers: {
|
|
|
+ Authorization: 'Bearer ' + that.token
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ PortType: 1,
|
|
|
+ Id:that.editid,
|
|
|
+ UserId:that.userid,
|
|
|
+ Instructions:that.ruleForm.desc,
|
|
|
+ SumPrice:that.SumPrice,
|
|
|
+ TransferTypeId:that.ruleForm.identification,
|
|
|
+ PriceTypeId:that.ruleForm.name,
|
|
|
+ CompanyId:that.ruleForm.company,
|
|
|
+ FeeContents:that.itemsArr
|
|
|
+ }
|
|
|
+ }).then(function (res) {
|
|
|
+ console.log(res)
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ that.$message({
|
|
|
+ message: res.data.msg,
|
|
|
+ type: 'success',
|
|
|
+ offset:50
|
|
|
+ });
|
|
|
+ that.$router.push({ path: "/home/DailyFeePayment"});
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getPostSearchDailyPaymentInfo(){
|
|
|
+ if(this.editid!=undefined){
|
|
|
+ console.log("jing")
|
|
|
+ this.fullscreenLoading=true;
|
|
|
+ var url = "/api/Financial/PostSearchDailyPaymentInfo"
|
|
|
+ var that = this
|
|
|
+ this.$axios({
|
|
|
+ method: 'post',
|
|
|
+ url: url,
|
|
|
+ headers: {
|
|
|
+ Authorization: 'Bearer ' + that.token
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ PortType: 1,
|
|
|
+ id:that.editid
|
|
|
+ }
|
|
|
+ }).then(function (res) {
|
|
|
+ console.log(res)
|
|
|
+ console.log(that.feeMarkSubTypeData)
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ that.itemsArr=res.data.data.feeContents;
|
|
|
+ that.ruleForm.desc=res.data.data.instructions;
|
|
|
+ setTimeout(function (){
|
|
|
+ for(var a=0;a<that.feeMarkSubTypeData.length;a++){
|
|
|
+ if(that.feeMarkSubTypeData[a].id==res.data.data.transferTypeId){
|
|
|
+ that.ruleForm.transferation=that.feeMarkSubTypeData[a].sTid;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ that.trans();
|
|
|
+ that.ruleForm.identification=res.data.data.transferTypeId;
|
|
|
+ for(var b=0;b<that.feeSubTypeData.length;b++){
|
|
|
+ if(that.feeSubTypeData[b].id==res.data.data.priceTypeId){
|
|
|
+ that.ruleForm.type=that.feeSubTypeData[b].sTid;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ that.typechange()
|
|
|
+ that.ruleForm.name=res.data.data.priceTypeId;
|
|
|
+ that.fullscreenLoading=false;
|
|
|
+ if(that.userid!=res.data.data.createUserId){
|
|
|
+ that.thesame=true;
|
|
|
+ }else if(res.data.data.fAudit!=0||res.data.data.mAudit!=0){
|
|
|
+ that.thesame=true;
|
|
|
+ }
|
|
|
+ if(that.thesame==true){
|
|
|
+ that.banned=true;
|
|
|
+ that.bannedtype=true;
|
|
|
+ }
|
|
|
+ },1000);
|
|
|
+ that.ruleForm.company=res.data.data.companyId;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted(){
|
|
|
+ this.editid=this.$route.query.id;
|
|
|
+ this.token = JSON.parse(localStorage.getItem('userinif')).token;
|
|
|
+ this.userid=JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
|
|
|
+ this.getTypeData();
|
|
|
+ this.getPostSearchDailyPaymentInfo();
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -245,4 +419,27 @@ export default {
|
|
|
.items-li .el-form-item{
|
|
|
margin-bottom: 10px;
|
|
|
}
|
|
|
+ .sub-box{
|
|
|
+ -ms-user-select: none;
|
|
|
+ -khtml-user-select: none;
|
|
|
+ -webkit-user-select: none;
|
|
|
+ -moz-user-select: none;
|
|
|
+ user-select: none;
|
|
|
+ font-family: cursive;
|
|
|
+ background-color: #FFF;
|
|
|
+ background-image: none;
|
|
|
+ border-radius: 4px;
|
|
|
+ border: 1px solid #DCDFE6;
|
|
|
+ -webkit-box-sizing: border-box;
|
|
|
+ box-sizing: border-box;
|
|
|
+ color: #606266;
|
|
|
+ display: inline-block;
|
|
|
+ height: 40px;
|
|
|
+ line-height: 40px;
|
|
|
+ outline: 0;
|
|
|
+ padding: 0 15px;
|
|
|
+ -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
|
|
|
+ transition: border-color .2s cubic-bezier(.645,.045,.355,1);
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
</style>
|