|
@@ -24,34 +24,34 @@
|
|
|
<view class="title"><text class="uni-form-item__title">关联合同</text></view>
|
|
|
<view class="uni-input-wrapper ">
|
|
|
<input class="uni-input-small" disabled=true v-model="contractName" />
|
|
|
- <a href='javascript:;' @click='getType' class="uni-icon"><i class="fa fa-search" aria-hidden="true"></i></a>
|
|
|
+ <a href='javascript:;' @click='getRelationContract' class="uni-icon"><i class="fa fa-search" aria-hidden="true"></i></a>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="uni-form-item uni-column">
|
|
|
+ <view class="uni-form-item uni-column" v-show="contractName">
|
|
|
<view class="title"><text class="uni-form-item__title">税率</text></view>
|
|
|
<view class="uni-input-wrapper">
|
|
|
-
|
|
|
+ {{contract.taxRate+'%'}}
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="uni-form-item uni-column">
|
|
|
+ <view class="uni-form-item uni-column" v-show="contractName">
|
|
|
<view class="title"><text class="uni-form-item__title">是否可抵扣</text></view>
|
|
|
- <view class="uni-input-wrapper">
|
|
|
-
|
|
|
+ <view class="uni-input-wrapper" >
|
|
|
+ {{contract.isDeduct==0?'否':'是'}}
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="uni-form-item uni-column">
|
|
|
<view class="title"><text class="uni-form-item__title">签证日期</text></view>
|
|
|
<view class="uni-input-wrapper" style="justify-content: left;">
|
|
|
- <picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindDateChange" v-model="viseDate" style="width: 100%;">
|
|
|
- <view class="uni-input">{{date}}</view>
|
|
|
+ <picker mode="date" @change="bindDateChange" v-model="viseDate" style="width: 100%;">
|
|
|
+ <view class="uni-input">{{viseDate}}</view>
|
|
|
</picker>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="uni-form-item uni-column">
|
|
|
<view class="title"><text class="uni-form-item__title">办理期限</text></view>
|
|
|
<view class="uni-input-wrapper" style="justify-content: left;">
|
|
|
- <picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindDateChange" v-model="endDate" style="width: 100%;">
|
|
|
- <view class="uni-input">{{date}}</view>
|
|
|
+ <picker mode="date" @change="bindDealDateChange" v-model="endDate" style="width: 100%;">
|
|
|
+ <view class="uni-input">{{endDate}}</view>
|
|
|
</picker>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -96,10 +96,50 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <uni-section title="费用明细" type="line">
|
|
|
-
|
|
|
- </uni-section>
|
|
|
+ <uni-section title="费用明细" type="line"></uni-section>
|
|
|
+ <uni-list>
|
|
|
+ <uni-list-item v-if="costList" v-for="(item, index) in costList" :key="index">
|
|
|
+ <view slot="body" class="slot-box">
|
|
|
+ <view class="row">
|
|
|
+ <view class="column-left">费用项:</view>
|
|
|
+ <view class="column-right">{{item.costCodeName}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="row">
|
|
|
+ <view class="column-left">含税金额</view>
|
|
|
+ <view class="column-right">
|
|
|
+ <input class="uni-input-small" type="digit" v-model="item.cash" style="width: 240px;text-align: left;" @blur='countTaxtCash(item,index)' />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="row">
|
|
|
+ <view class="column-left">税额</view>
|
|
|
+ <view class="column-right" >
|
|
|
+ <input class="uni-input-small" type="digit" disabled="true" v-model="item.rateCash" style="width: 240px;text-align: left;" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="row">
|
|
|
+ <view class="column-left">金额</view>
|
|
|
+ <view class="column-right">
|
|
|
+ <input class="uni-input-small" type="digit" disabled="true" v-model="item.noRateCash" style="width: 240px;text-align: left;" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="row">
|
|
|
+ <view class="column-left">备注:</view>
|
|
|
+ <view class="column-right">
|
|
|
+ <textarea focus v-model="item.remark" auto-height="true" style="width: 240px;text-align: left;" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="row">
|
|
|
+ <view class="column-left">操作:</view>
|
|
|
+ <view class="column-right">
|
|
|
+ <i class="fa fa-window-close" aria-hidden="true" @click="delRow(index)" style="font-size:20px;cursor: pointer;color: #999;margin-left:15px;" title="删除"></i>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-list-item>
|
|
|
+ </uni-list>
|
|
|
+ <view style="margin-bottom: 120px;">
|
|
|
|
|
|
+ </view>
|
|
|
<view class="uni-btn-v uni-column">
|
|
|
<button type="primary" form-type="submit" style="border-radius: 15px;" >提交</button>
|
|
|
</view>
|
|
@@ -111,18 +151,9 @@
|
|
|
<script>
|
|
|
|
|
|
import {GetQianzhengDropDown} from "@/common/api/requisitionApi.js";
|
|
|
- import {GetUserDepartment} from "@/common/api/commonApi.js";
|
|
|
+ import {GetContractCostDTOs} from "@/common/api/viseApi.js";
|
|
|
import {Decimal} from 'decimal.js'; //decimal计算
|
|
|
- var sourceType = [
|
|
|
- ['camera'],
|
|
|
- ['album'],
|
|
|
- ['camera', 'album']
|
|
|
- ]
|
|
|
- var sizeType = [
|
|
|
- ['compressed'],
|
|
|
- ['original'],
|
|
|
- ['compressed', 'original']
|
|
|
- ]
|
|
|
+
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
@@ -133,12 +164,14 @@
|
|
|
requisitionName:'', //申请单名称
|
|
|
contractCode:'',
|
|
|
contractName:'',
|
|
|
+ contract:{}, //获取的关联合同信息
|
|
|
viseDate:this.$util.getDate({
|
|
|
format: true
|
|
|
}),
|
|
|
endDate:this.$util.getDate({
|
|
|
format: true
|
|
|
}),
|
|
|
+
|
|
|
viseType:'',
|
|
|
|
|
|
userCode:this.$store.state.user.userCode, //经办人编号
|
|
@@ -148,14 +181,11 @@
|
|
|
reportCash:0.00,
|
|
|
reason:'',
|
|
|
remark:'',
|
|
|
-
|
|
|
+ costList:[], //费用明细
|
|
|
contractList:[],
|
|
|
- title: 'choose/previewImage',
|
|
|
+
|
|
|
imageList: [],
|
|
|
- sourceTypeIndex: 2,
|
|
|
- sourceType: ['拍照', '相册', '拍照或相册'],
|
|
|
- sizeTypeIndex: 2,
|
|
|
- sizeType: ['压缩', '原图', '压缩或原图'],
|
|
|
+
|
|
|
countIndex: 5,
|
|
|
count: [1, 2, 3, 4, 5],
|
|
|
title1: 'picker',
|
|
@@ -208,67 +238,110 @@
|
|
|
submitForm(e) {
|
|
|
console.info('submitForm');
|
|
|
let _this=this;
|
|
|
- if(this.requisitionName==='')
|
|
|
+ if(this.viseId==='')
|
|
|
{
|
|
|
uni.showToast({
|
|
|
icon:"none",
|
|
|
- title:"请填写申请单名称",
|
|
|
+ title:"请填写签证编号",
|
|
|
duration:3000
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- if(this.requisitionName.length>50)
|
|
|
+ if(this.viseName==='')
|
|
|
{
|
|
|
uni.showToast({
|
|
|
icon:"none",
|
|
|
- title:"申请单名称不能多于50字",
|
|
|
+ title:"请填写签证名称",
|
|
|
duration:3000
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- if(this.requisitionDate===""){
|
|
|
+ if(this.viseName.length>50)
|
|
|
+ {
|
|
|
uni.showToast({
|
|
|
icon:"none",
|
|
|
- title:"申请日期不能为空",
|
|
|
+ title:"签证名称不能多于50字",
|
|
|
duration:3000
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- if(this.changeType===""){
|
|
|
+ if(this.requisitionCode===""){
|
|
|
uni.showToast({
|
|
|
icon:"none",
|
|
|
- title:"签证类型不能为空",
|
|
|
+ title:"请选择申请单",
|
|
|
duration:3000
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- if(this.requisitionReason===""){
|
|
|
+ if(this.contractCode===""){
|
|
|
uni.showToast({
|
|
|
icon:"none",
|
|
|
- title:"原因不能为空",
|
|
|
+ title:"请选择关联合同号",
|
|
|
+ duration:3000
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(this.viseDate===""){
|
|
|
+ uni.showToast({
|
|
|
+ icon:"none",
|
|
|
+ title:"请选择签证日期",
|
|
|
+ duration:3000
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(this.endDate===""){
|
|
|
+ uni.showToast({
|
|
|
+ icon:"none",
|
|
|
+ title:"请选择办理期限",
|
|
|
+ duration:3000
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(this.changeType===""){
|
|
|
+ uni.showToast({
|
|
|
+ icon:"none",
|
|
|
+ title:"签证类型不能为空",
|
|
|
duration:3000
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- if(this.requisitionReason.length>5000){
|
|
|
+ if(this.requisitionReason===""){
|
|
|
uni.showToast({
|
|
|
icon:"none",
|
|
|
- title:"原因不能超过500字",
|
|
|
+ title:"原因不能为空",
|
|
|
duration:3000
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
+ if(this.reason!=""){
|
|
|
+ if(this.reason.length>500){
|
|
|
+ uni.showToast({
|
|
|
+ icon:"none",
|
|
|
+ title:"原因不能超过500字",
|
|
|
+ duration:3000
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if(this.remark!==""){
|
|
|
if(this.remark.length>500){
|
|
|
uni.showToast({
|
|
|
icon:"none",
|
|
|
- title:"签备注不能超过500字",
|
|
|
+ title:"备注不能超过500字",
|
|
|
duration:3000
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ if(this.costList.length<=0){
|
|
|
+ uni.showToast({
|
|
|
+ icon:"none",
|
|
|
+ title:"费用明细不能为空",
|
|
|
+ duration:3000
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
var requisitionDTO={requisitionName:this.requisitionName,requisitionDate:this.requisitionDate,changeType:this.changeType,requisitionReason:this.requisitionReason,remark:this.remark,person:this.userCode,unitCode:this.unitCode,projectCode:this.$store.state.projectCode};
|
|
|
|
|
@@ -318,8 +391,7 @@
|
|
|
获取申请单
|
|
|
*/
|
|
|
getRequisition() {
|
|
|
- let _this = this;
|
|
|
- //console.info('gettype',_this);
|
|
|
+ let _this = this;
|
|
|
_this.saveTemp(_this);
|
|
|
//创建名字为fire的监听器,监听子页面传值事件
|
|
|
uni.$on('requisition', function(data) {
|
|
@@ -339,6 +411,81 @@
|
|
|
url: '/pages/template/SelectRelationRequision/SelectRelationRequision'
|
|
|
});
|
|
|
},
|
|
|
+ /*
|
|
|
+ 获取关联合同
|
|
|
+ */
|
|
|
+ getRelationContract() {
|
|
|
+ let _this = this;
|
|
|
+ _this.saveTemp(_this);
|
|
|
+ //创建名字为fire的监听器,监听子页面传值事件
|
|
|
+ uni.$on('contract', function(data) {
|
|
|
+ console.info("监听getRelationContract子页面的传值", data);
|
|
|
+ //console.info('监听',_this);
|
|
|
+ _this.getTemp(_this);
|
|
|
+ _this.contractCode=data[0].contractCode;
|
|
|
+ _this.contractName=data[0].contractName;
|
|
|
+ _this.contract=data[0].contract;
|
|
|
+ _this.getCostList();
|
|
|
+ _this.$nextTick(function(){
|
|
|
+ //更新dom
|
|
|
+ });
|
|
|
+
|
|
|
+ //接收一次监听,一旦监听到回传值,则清除监听事件,若不清除,会占用资源
|
|
|
+ uni.$off("contract");
|
|
|
+ });
|
|
|
+ let requisitionCode=_this.requisitionCode;
|
|
|
+ if(requisitionCode==""){
|
|
|
+ uni.showToast({
|
|
|
+ title:'请先选择申请单',
|
|
|
+ icon:'none',
|
|
|
+ duration:3000
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/template/SelectRelationContract/SelectRelationContract?requisitionCode='+requisitionCode
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /*
|
|
|
+ 获取费用明细
|
|
|
+ */
|
|
|
+ getCostList() {
|
|
|
+ let _this = this;
|
|
|
+ _this.saveTemp(_this);
|
|
|
+ if(_this.contractCode){
|
|
|
+ GetContractCostDTOs(_this.contractCode).then(res=>{
|
|
|
+ console.info('GetContractCostDTOs',res);
|
|
|
+ if(res.length>0){
|
|
|
+ res.forEach(function(item,index,arr){
|
|
|
+ item.cash=0.00;
|
|
|
+ item.rateCash=0.00;
|
|
|
+ item.noRateCash=0.00;
|
|
|
+ _this.$set(_this.costList,index,item);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ delRow: function(index) {
|
|
|
+ console.info("删除");
|
|
|
+ console.info(this.costList[index]);
|
|
|
+ this.costList.splice(index, 1);
|
|
|
+ },
|
|
|
+ /* 计算该行的税额 */
|
|
|
+ countTaxtCash:function(item,index){
|
|
|
+ let _this=this;
|
|
|
+
|
|
|
+ //console.info("countTaxtCash",item);
|
|
|
+ //console.info("countTaxtCash",index);
|
|
|
+ //let value=event.detail.value;
|
|
|
+ let taxRate=_this.contract.taxRate;
|
|
|
+ item.rateCash=item.cash*taxRate;
|
|
|
+ item.noRateCash=item.cash-item.rateCash;
|
|
|
+
|
|
|
+ },
|
|
|
bindPickerChange: function(e) {
|
|
|
//console.log('picker发送选择改变,携带值为:' + e.detail.value);
|
|
|
//console.info(e.detail);
|
|
@@ -347,113 +494,14 @@
|
|
|
console.info(this.changeType);
|
|
|
},
|
|
|
bindDateChange: function(e) {
|
|
|
- this.date = e.detail.value;
|
|
|
- this.requisitionDate=this.date;
|
|
|
- console.info(this.date);
|
|
|
- },
|
|
|
- sourceTypeChange: function(e) {
|
|
|
- this.sourceTypeIndex = parseInt(e.detail.value)
|
|
|
- },
|
|
|
- sizeTypeChange: function(e) {
|
|
|
- this.sizeTypeIndex = parseInt(e.detail.value)
|
|
|
- },
|
|
|
- countChange: function(e) {
|
|
|
- this.countIndex = e.detail.value;
|
|
|
- },
|
|
|
- chooseImage: async function() {
|
|
|
- console.info("chooseImage");
|
|
|
- // #ifdef APP-PLUS
|
|
|
- // TODO 选择相机或相册时 需要弹出actionsheet,目前无法获得是相机还是相册,在失败回调中处理
|
|
|
- if (this.sourceTypeIndex !== 2) {
|
|
|
- let status = await this.checkPermission();
|
|
|
- if (status !== 1) {
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- // #endif
|
|
|
- console.info(this.imageList);
|
|
|
- if (this.imageList.length === 5) {
|
|
|
- let isContinue = await this.isFullImg();
|
|
|
- console.log("是否继续?", isContinue);
|
|
|
- if (!isContinue) {
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- uni.chooseImage({
|
|
|
- sourceType: sourceType[this.sourceTypeIndex],
|
|
|
- sizeType: sizeType[this.sizeTypeIndex],
|
|
|
- count: this.imageList.length + this.count[this.countIndex] > 5 ? 5 - this.imageList.length : this.count[this.countIndex],
|
|
|
- success: (res) => {
|
|
|
- console.info("res.tempFiles");
|
|
|
- console.info(res.tempFiles);
|
|
|
- this.imageList = this.imageList.concat(res.tempFilePaths);
|
|
|
-
|
|
|
- console.info(this.imageList);
|
|
|
- },
|
|
|
- fail: (err) => {
|
|
|
- // #ifdef APP-PLUS
|
|
|
- if (err['code'] && err.code !== 0 && this.sourceTypeIndex === 2) {
|
|
|
- this.checkPermission(err.code);
|
|
|
- }
|
|
|
- // #endif
|
|
|
- // #ifdef MP
|
|
|
- uni.getSetting({
|
|
|
- success: (res) => {
|
|
|
- let authStatus = false;
|
|
|
- switch (this.sourceTypeIndex) {
|
|
|
- case 0:
|
|
|
- authStatus = res.authSetting['scope.camera'];
|
|
|
- break;
|
|
|
- case 1:
|
|
|
- authStatus = res.authSetting['scope.album'];
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- authStatus = res.authSetting['scope.album'] && res.authSetting['scope.camera'];
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
- if (!authStatus) {
|
|
|
- uni.showModal({
|
|
|
- title: '授权失败',
|
|
|
- content: 'Hello uni-app需要从您的相机或相册获取图片,请在设置界面打开相关权限',
|
|
|
- success: (res) => {
|
|
|
- if (res.confirm) {
|
|
|
- uni.openSetting()
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- // #endif
|
|
|
- }
|
|
|
- })
|
|
|
+ let date = e.detail.value;
|
|
|
+ this.viseDate=date;
|
|
|
+ console.info('bindDateChange',this.viseDate);
|
|
|
},
|
|
|
- isFullImg: function() {
|
|
|
- return new Promise((res) => {
|
|
|
- uni.showModal({
|
|
|
- content: "已经有5张图片了,是否清空现有图片?",
|
|
|
- success: (e) => {
|
|
|
- if (e.confirm) {
|
|
|
- this.imageList = [];
|
|
|
- res(true);
|
|
|
- } else {
|
|
|
- res(false)
|
|
|
- }
|
|
|
- },
|
|
|
- fail: () => {
|
|
|
- res(false)
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
- previewImage: function(e) {
|
|
|
- var current = e.target.dataset.src
|
|
|
- uni.previewImage({
|
|
|
- current: current,
|
|
|
- urls: this.imageList
|
|
|
- })
|
|
|
+ bindDealDateChange: function(e) {
|
|
|
+ let date = e.detail.value;
|
|
|
+ this.endDate=date;
|
|
|
+ console.info('bindDealDateChange',this.endDate);
|
|
|
},
|
|
|
|
|
|
GetDropDown:function(){
|
|
@@ -467,11 +515,6 @@
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- delRow:function(index){
|
|
|
- console.info(index);
|
|
|
- console.info(this.contractList[index]);
|
|
|
- this.contractList.splice(index,1);
|
|
|
- },
|
|
|
/*
|
|
|
上传后返回的值:
|
|
|
list:上传后图片数组
|
|
@@ -671,6 +714,7 @@
|
|
|
width: 24px;
|
|
|
height: 24px;
|
|
|
line-height: 24px;
|
|
|
+ margin-left:15px;
|
|
|
color: #999999;
|
|
|
}
|
|
|
|
|
@@ -722,4 +766,6 @@
|
|
|
color: #888;
|
|
|
background-color: #eeeeee;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
</style>
|