123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601 |
- <template>
- <view class="container">
- <u-form ref="uForm">
- <view class="form_item">
- <view class="title">申请信息</view>
- <!-- <u-divider ></u-divider> -->
- <u-form-item label-width='260' label="业务编号" :borderBottom="false">
- <u-input v-model="tradeList.billNo" input-align="right" placeholder="暂无" disabled />
- </u-form-item>
- <u-form-item label-width='260' label="名头" :borderBottom="false">
- <u-input v-model="tradeList.renown" input-align="right" placeholder="暂无" disabled />
- </u-form-item>
- <u-form-item label-width='260' label="仓库名称" :borderBottom="false">
- <u-input v-model="tradeList.warehouseName" input-align="right" placeholder="暂无" disabled />
- </u-form-item>
- <u-form-item label-width='260' label="仓位号" :borderBottom="false">
- <u-input v-model="tradeList.warehouseNo" input-align="right" placeholder="暂无" disabled />
- </u-form-item>
- <u-form-item label-width='260' label="仓库地址" :borderBottom="false">
- <u-input v-model="tradeList.warehouseAddress" input-align="right" placeholder="暂无" disabled />
- </u-form-item>
- <u-form-item label-width='260' label="货名" :borderBottom="false">
- <u-input v-model="tradeList.goodsName" input-align="right" placeholder="暂无" disabled />
- </u-form-item>
- <u-form-item label-width='260' label="品级" :borderBottom="false">
- <u-input v-model="tradeList.grade" input-align="right" placeholder="暂无" disabled />
- </u-form-item>
- <u-form-item label-width='260' label="现有储量(吨)" :borderBottom="false">
- <u-input v-model="tradeList.nowWeight" input-align="right" placeholder="暂无" disabled />
- </u-form-item>
- <u-form-item label-width='260' label="可用储量(吨)" :borderBottom="false">
- <u-input v-model="tradeList.useWeight" input-align="right" placeholder="暂无" disabled />
- </u-form-item>
- <u-form-item label-width='260' label="本单重量(吨)" :borderBottom="false">
- <u-input v-model="tradeList.weight" input-align="right" placeholder="暂无" disabled />
- </u-form-item>
- <u-form-item label-width='260' label="单价(元/吨)" :borderBottom="false">
- <u-input v-model="tradeList.unitPrice" input-align="right" placeholder="暂无" disabled />
- </u-form-item>
- <u-form-item label-width='260' label="总价值(元)" :borderBottom="false">
- <u-input v-model="tradeList.totalValue" input-align="right" placeholder="暂无" disabled />
- </u-form-item>
- <u-form-item label-width='260' label="申请比例(%)" :borderBottom="false">
- <u-input v-model="tradeList.applicationProportion" input-align="right" placeholder="暂无" disabled />
- </u-form-item>
- <u-form-item label-width='260' label="申请金额(元)" :borderBottom="false">
- <u-input v-model="tradeList.interest" input-align="right" placeholder="暂无" disabled />
- </u-form-item>
- </view>
- <view class="form_item">
- <view class="title">附件</view>
- <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="0"
- :file-list="imgUrl" :size-type="['compressed']" @on-success="getImgUrl" :deletable="false"
- :showProgress="false" @on-uploaded="isAdd = true" :before-upload="filterFileType"
- @on-progress="onProgress"></upload>
- </view>
- <view class="form_item">
- <view class="title">外审部门</view>
- <u-form-item label-width='260' label="银行" :borderBottom="false">
- <u-input v-model="tradeList.bank" input-align="right" placeholder="暂无" disabled />
- </u-form-item>
- <u-form-item label-width='260' label="第三方" :borderBottom="false">
- <u-input v-model="tradeList.three" input-align="right" placeholder="暂无" disabled />
- </u-form-item>
- </view>
- <view class="form_item" v-if="tradeList.approveStatus == '待银行审批'">
- <view class="title">发放信息</view>
- <u-form-item label-width='260' label="合同编号">
- <u-input v-model="tradeList.contractNo" input-align="right" placeholder="请输入合同编号" />
- </u-form-item>
- <u-form-item label-width='260' label="发放金额(元)">
- <u-input v-model="tradeList.paymentAmount" input-align="right" type="digit" @input="calculation()" placeholder="请输入发放金额" />
- </u-form-item>
- <view v-for="(item,index) in count">
- <view class="row">
- <view class="left ">
- <u-input v-model="item.modifyExpense" placeholder="输入费用名称,1-8个字" maxlength="8"/>
- </view>
- <view class="right">
- <u-input v-model="item.expenses" @input="calculation" input-align="right" placeholder="输入金额" type="digit" />
- </u-input><span class="yuan">元</span>
- <view class="del" @click="del(index)">—</view>
- </view>
- </view>
- </view>
- <view class="flex count">
- <view class="add">
- <u-button @click="add" type="success" class="btnAdd" :disabled="addshow">添加费用</u-button>
- </view>
- <view class=" flex count_item">
- <span>合计应还:</span><span class="number">¥{{tradeList.amountDue}}</span>
- </view>
- </view>
- </view>
- </u-form>
- <view class="form_item flex">
- <view class="auditInfo flex" @click="auditInfo">
- <view class="title1">审核记录</view>
- <view class="img">
- <image src="../../../static/img/myimg/gengduo1@3x.png"
- style="width: 16rpx; height: 30rpx;top: 20rpx;margin-right: 0rpx;"></image>
- </view>
- </view>
- </view>
- <view style='padding:10px;' class='flex bottom-btn'>
- <u-button @click='reject' type="error" class="btn1" hover-class='none'>驳回</u-button>
- <u-button @click='pass' type="success" class="btn2">通过</u-button>
- </view>
- <view v-if="show" class="shade">
- <view class="wrap">
- <view class="alert-top">
- <view class="titleAudit">
- {{title}}
- </view>
- <u-icon name="close" class="close" color="#8890B1" @click="close()"></u-icon>
- </view>
- <view class="u-textarea-style">
- <view class="right-bottom">
- {{auditMind.length}}/1000个字
- </view>
- <u-input class="" v-model='auditMind' placeholder="请在此输入审核意见" type="textarea" height="414"
- maxlength="1000" />
- </view>
- <view @click='close()' class="cancel">取消</view>
- <view @click='passSubmit()' class="confirm">确定</view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import upload from '@/components/upload.vue';
- export default {
- components: {
- upload
- },
- data() {
- return {
- id: "",
- action: this.$uploadUrl,
- maxSize: 50 * 1024 * 1024, //限制文件大小 50M
- btnLoading: false, //防止重复点击
- imgUrl: [],
- tradeList: {},
- isShowAlert: false,
- show: false,
- content: "",
- title: "",
- auditMind: "", //审核意见
- count: [],
- addshow: false
- }
- },
- onLoad(options) {
- this.id = options.id
- this.getList()
- },
- onshow() {
- },
- methods: {
- calculation() {
- let money = Number(this.tradeList.paymentAmount)
- for (let i = 0; i < this.count.length; i++) {
- money += Number(this.count[i].expenses)
- }
- this.tradeList.amountDue = money.toFixed(2)
- },
- del(num) {
- this.count.splice(num, 1)
- if (this.count.length == 4) {
- this.addshow = true
- } else {
- this.addshow = false
- }
- let money = Number(this.tradeList.paymentAmount)
- for (let i = 0; i < this.count.length; i++) {
- money += Number(this.count[i].expenses)
- }
- this.tradeList.amountDue = money.toFixed(2)
- },
- add() {
- this.count.push({
- modifyExpense: "",
- expenses: ""
- })
- if (this.count.length == 4) {
- this.addshow = true
- } else {
- this.addshow = false
- }
- },
- getList() {
- var that = this
- that.$api.doRequest('get', '/tradeWarehouseReceiptAppl/getTrageInfo', {
- id: that.id
- }).then(res => {
- that.tradeList = res.data.data
- // if (that.tradeList.approveStatus == "待银行审批") {
- // that.tradeList.amountDue = that.tradeList.interest
- // }
- //通过图片id找到地址
- that.$api.doRequest('get', '/appendix/query/getFileList', {
- appendixIds: that.tradeList.appendix
- }).then(res => {
- for (let i = 0; i < res.data.data.length; i++) {
- that.imgUrl.push({
- url: res.data.data[i].appendixPath
- })
- }
- }).catch(res => {
- if (res.errmsg) {
- uni.showToast({
- title: res.errmsg,
- icon: 'none',
- duration: 2000
- })
- }
- });
- })
- },
- reject() {
- this.show = true
- this.title = "驳回原因(驳回)"
- },
- pass() {
- if(this.tradeList.approveStatus == "待银行审批"){
- if (!this.tradeList.contractNo) {
- this.$api.msg('合同编号不能为空!')
- return
- }
- if (!this.tradeList.paymentAmount) {
- this.$api.msg('发放金额不能为空!')
- return
- }
- for(var index = 0 ; index < this.count.length;index++){
- if(!this.count[index].modifyExpense){
- this.$api.msg('请输入费用名称!')
- return
- }
- if(!this.count[index].expenses){
- this.$api.msg('请输入费用!')
- return
- }
- if(Number(this.count[index].expenses) < 1 || Number(this.count[index].expenses) > 100000000){
- this.$api.msg('费用输入有误!')
- return
- }
- if(this.count[index].expenses.toString().split(".")[1]){
- if(this.count[index].expenses.toString().split(".")[1].length > 2){
- this.$api.msg('费用请保留两位小数!')
- return
- }
- }
- if(index == 0){
- this.tradeList.modifyExpense1 = this.count[index].modifyExpense
- this.tradeList.applicationAmount = this.count[index].expenses
- this.tradeList.applicationAmountFlag = "显示中"
- }else if(index == 1){
- this.tradeList.modifyExpense2 = this.count[index].modifyExpense
- this.tradeList.supervisionFee = this.count[index].expenses
- this.tradeList.supervisionFeeFlag = "显示中"
- }else if(index == 2){
- this.tradeList.modifyExpense3 = this.count[index].modifyExpense
- this.tradeList.insurancePremium = this.count[index].expenses
- this.tradeList.insurancePremiumFlag = "显示中"
- }else if(index == 3){
- this.tradeList.modifyExpense4 = this.count[index].modifyExpense
- this.tradeList.otherFee = this.count[index].expenses
- this.tradeList.otherFeeFlag = "显示中"
- }
- }
- }
- this.show = true
- this.title = "审核意见(通过)"
- },
- close() {
- this.show = false
- },
- passSubmit() {
- if (this.title == "驳回原因(驳回)") {
- if (!this.auditMind) {
- this.$api.msg('驳回意见不能为空')
- return
- }
- uni.showLoading({
- title: "审核中"
- })
- this.$api.doRequest('post', '/newWorkflow/api/handle', {
- taskId: this.tradeList.taskId,
- approved: false,
- auditMind: this.auditMind,
- needReapply: true,
- }).then(res => {
- uni.hideLoading()
- if (res.data.code == 200) {
- uni.showToast({
- title: "驳回成功",
- icon: 'none',
- duration: 2000
- })
- uni.navigateBack()
- }
- }).catch(res => {
- uni.hideLoading()
- if (res.errmsg) {
- uni.showToast({
- title: res.errmsg,
- icon: 'none',
- duration: 2000
- })
- }
- });
- } else {
- uni.showLoading({
- title: "审核中"
- })//通过
- if(this.tradeList.approveStatus == "待银行审批"){
- this.tradeList.amountToRepaid = this.tradeList.amountDue//设置待还金额 = 应还金额
- this.$api.doRequest('post', '/tradeWarehouseReceiptAppl/api/editTradeWarehouseReceiptAppl', this.tradeList)
- .then(res => {
- if(res.data.code == 200){
- this.$api.doRequest('post', '/newWorkflow/api/handle', {
- taskId: this.tradeList.taskId,
- approved: true,
- auditMind: this.auditMind ? this.auditMind : "审核通过",
- needReapply: false,
- }).then(res => {
- uni.hideLoading()
- if (res.data.code == 200) {
- uni.showToast({
- title: "审核成功",
- icon: 'none',
- duration: 2000
- })
- uni.navigateBack()
- }
- }).catch(res => {
- uni.hideLoading()
- if (res.errmsg) {
- uni.showToast({
- title: res.errmsg,
- icon: 'none',
- duration: 2000
- })
- }
- });
- }
- })
- }else{
- this.$api.doRequest('post', '/newWorkflow/api/handle', {
- taskId: this.tradeList.taskId,
- approved: true,
- auditMind: this.auditMind ? this.auditMind : "审核通过",
- needReapply: false,
- }).then(res => {
- uni.hideLoading()
- if (res.data.code == 200) {
- uni.showToast({
- title: "审核成功",
- icon: 'none',
- duration: 2000
- })
- uni.navigateBack()
- }
- }).catch(res => {
- uni.hideLoading()
- if (res.errmsg) {
- uni.showToast({
- title: res.errmsg,
- icon: 'none',
- duration: 2000
- })
- }
- });
- }
- }
- },
- auditInfo() {
- uni.navigateTo({
- url: '/pages/task/audit_info?id=' + this.tradeList.id + "&workflowId=" + this.tradeList.workflowId
- })
- },
- filterFileType(index, lists) {
- if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif' &&
- lists[index].fileType != 'jpeg') {
- lists.splice(index, 1);
- // 当前文件不支持
- uni.showModal({
- title: '暂不支持当前图片类型',
- showCancel: false
- });
- } else {
- this.isAdd = false;
- }
- },
- }
- }
- </script>
- <style scoped lang="scss">
- .container {
- padding: 6rpx 12rpx 250rpx 12rpx;
- }
- .title {
- font-size: 34rpx;
- font-weight: 600;
- margin-top: 20rpx;
- line-height: 90rpx;
- border-bottom: 2rpx solid #EEEEEE;
- }
- .form_item {
- background: #fff;
- margin: 10px;
- border-radius: 10px;
- padding: 10rpx 30rpx;
- // width: 100%;
- }
- .u-form-item {
- padding: 12rpx 0 !important;
- }
- .auditInfo {
- width: 100%;
- .title1 {
- width: 99%;
- font-size: 34rpx;
- font-weight: 600;
- // margin-top: 20rpx;
- line-height: 70rpx;
- }
- }
- .bottom-btn {
- width: 100%;
- position: fixed;
- bottom: 0;
- display: flex;
- z-index: 2;
- left: 0;
- background-color: #f8f8f8;
- flex-direction: column;
- .btn1,
- .btn2 {
- width: 100%;
- margin-bottom: 26rpx;
- border-radius: 90rpx;
- }
- .btn1 {
- background: white;
- color: #00C265;
- }
- }
- .shade {
- position: fixed;
- top: 0;
- left: 0;
- height: 100%;
- width: 100%;
- background: rgba(0, 0, 0, 0.4);
- z-index: 3;
- .wrap {
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- margin: auto;
- background: #fff;
- width: calc(100% - 198rpx);
- height: 700rpx;
- border-radius: 20rpx;
- .alert-top {
- padding: 33rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- position: relative;
- }
- .titleAudit {
- font-size: 32rpx;
- font-weight: 600;
- color: #333333;
- }
- .close {
- position: absolute;
- right: 33rpx;
- }
- }
- }
- .cancel,
- .confirm {
- position: absolute;
- display: inline-block;
- width: 50%;
- text-align: center;
- bottom: 0;
- padding: 10px;
- border-top: 1px solid #eee;
- font-size: 34rpx;
- }
- .cancel {
- left: 0;
- border-right: 1px solid #eee;
- color: #AFB3BF;
- }
- .confirm {
- right: 0;
- color: #22C572;
- }
- .u-textarea-style {
- margin: 20rpx;
- background: #F9F9FA;
- border-radius: 10px;
- border: 1px solid #EEEEEE;
- padding: 10rpx 20rpx;
- position: relative;
- .right-bottom {
- position: absolute;
- right: 20rpx;
- bottom: 20rpx;
- color: #AFB3BF;
- }
- }
- .row {
- display: flex;
- justify-content: space-between;
- border-bottom: 1px solid #eee;
- .right {
- display: flex;
- // .uni-input-input{
- // width: 30%;
- // font-size: 28rpx;
- // }
- .del {
- width: 46rpx;
- height: 46rpx;
- border-radius: 25rpx;
- background-color: #F1F4FB;
- text-align: center;
- line-height: 46rpx;
- font-weight: 600;
- margin-top: 8rpx;
- }
- .yuan {
- line-height: 70rpx;
- margin: 0 16rpx;
- }
- }
- }
- .count {
- width: 100%;
- margin: 20rpx 0;
- .add {
- width: 162rpx;
- height: 64rpx;
- background: #22C572;
- border-radius: 10rpx;
- color: #FFFFFF;
- line-height: 64rpx;
- text-align: center;
- font-size: 28rpx;
- }
- .count_item {
- width: 70%;
- justify-content: flex-end;
- font-size: 30rpx;
- line-height: 70rpx;
- .number {
- font-size: 32rpx;
- font-weight: 600;
- margin-left: 20rpx;
- }
- }
- }
- /deep/.u-list-item {
- margin: 20rpx 4rpx !important;
- }
- </style>
|