123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370 |
- <template>
- <view class="warp">
- <view class="topInfo">
- <view class="topInfo-item">
- <view class="flex info">
- <view class="logo">
- <image src="../../../static/img/reject.png" mode="" v-if="list.status == '已驳回'"
- style="height: 40rpx;"></image><!-- 驳回 -->
- <image src="../../../static/img/tongguo.png" mode="" v-if="list.status == '已通过'"
- style="height: 40rpx;"></image><!-- 通过 -->
- <image src="../../../static/img/daishenhe.png" mode="" v-if="list.status == '审核中'"
- style="height: 40rpx;"></image><!-- 待审核 -->
- </view>
- <view class="infoText">{{list.status}}</view>
- </view>
- <view class="infoData">{{list.updateDate}}</view>
- </view>
- </view>
- <view class='content1'>
- <view class="title">基本信息</view>
- <view class='row'>
- <view class="left">仓库</view>
- <view class="right">{{list.warehouseName}}</view>
- </view>
- <view class='row'>
- <view class="left">货名</view>
- <view class="right">{{list.goodsName}}</view>
- </view>
- <view class='row'>
- <view class="left">基准水分(%)</view>
- <view class="right">{{list.waterBase}}</view>
- </view>
- <view class='row'>
- <view class="left">干粮水分(%)</view>
- <view class="right">{{list.waterMin}}</view>
- </view>
- <view class='row'>
- <view class="left">水分上限(%)</view>
- <view class="right">{{list.waterMax}}</view>
- </view>
- <view v-if="list.paramType == '2'" class='row'>
- <view class="left">扣重比</view>
- <view class="right">{{list.deductWeight}}</view>
- </view>
- <view class='row'>
- <view class="left">干粮收购价格(元/公斤)</view>
- <view class="right">{{list.dryGrainPrice}}</view>
- </view>
- <view class='row boder'>
- <view class="left">销售上限</view>
- <view class="right">{{list.saleLimit}}</view>
- </view>
- </view>
- <view class="content2">
- <view class="title">粮价设置</view>
- <view v-for="(item,index) in list.details" :key="index">
- <view class="row">
- <view class="left">等级</view>
- <view class="right">{{item.level}}</view>
- </view>
- <view v-if="list.paramType == '2'" class="row">
- <view class="left">基准单价(元/公斤)</view>
- <view class="right">{{item.basePrice}}</view>
- </view>
- <view class="row" v-for="(item1,index1) in item.modelList" :key="index1"
- :class="index1==item.modelList.length-1?'boder':''">
- <view v-if="list.paramType == '2'" class="left">{{item1.startWater}}-{{item1.endWater}}降幅(元/0.1%)
- </view>
- <view v-else class="left">{{item1.startWater}}-{{item1.endWater}}扣重比</view>
- <view class="right">{{item1.price}}</view>
- </view>
- </view>
- </view>
- <u-popup v-model="show1" mode="center">
- <view style="width: 300px;padding: 30rpx 10rpx;border-radius: 20rpx;">
- <view class="rejectText">审核意见(驳回)</view>
- <u-input v-model="rejectInfo" type="textarea" :border="border" class="rejectInfoCss"
- placeholder="请输入审核意见" />
- <view class="flex">
- <u-button @click="show1 = false" type="error" hover-class='none'>取消</u-button>
- <u-button @click="reject()" type="success">确定</u-button>
- </view>
- </view>
- </u-popup>
- <u-popup v-model="show2" mode="center">
- <view style="width: 300px;padding: 30rpx 10rpx;border-radius: 20rpx;">
- <view class="rejectText">审核意见(通过)</view>
- <u-input v-model="rejectInfo1" type="textarea" :border="border" :height="height"
- :auto-height="autoHeight" class="rejectInfoCss" placeholder="请输入审核意见" />
- <view class="flex">
- <u-button @click="show2 = false" type="error" hover-class='none'>取消</u-button>
- <u-button @click="audit()" type="success">确定</u-button>
- </view>
- </view>
- </u-popup>
- <u-toast ref="uToast" />
- <view style='padding:10px;' class='flex bottom-btn'>
- <u-button v-if='isSHowBtn' @click='show1 = true' type="error" class="btn1" hover-class='none'>驳回</u-button>
- <u-button v-if='isSHowBtn' @click='show2 = true' type="success" class="btn2">通过</u-button>
- </view>
- </view>
- </template>
- <script>
- import helper from '@/common/helper.js';
- import {
- mapState
- } from 'vuex';
- export default {
- name: "task",
- data() {
- return {
- everyCheck: '',
- isSHowBtn: true,
- show: false,
- height: 200,
- autoHeight: true,
- border: false,
- show2: false,
- show1: false,
- rejectInfo: "",
- rejectInfo1: "",
- id: 0,
- list: {},
- pcUserInfo: uni.getStorageSync('pcUserInfo'),
- switchVal: false,
- contractNoList: []
- };
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo'])
- },
- onBackPress(e) {
- uni.navigateTo({
- url: "/pages/task/my_task"
- })
- return true;
- },
- onLoad(options) {
- this.everyCheck = uni.getStorageSync("everyTask")
- this.id = options.id
- this.isSHowBtn = options.isShowbtn
- },
- onShow() {
- var that = this
- this.$nextTick(function() {
- that.getData()
- })
- },
- methods: {
- getData() {
- var data = []
- this.$api.doRequest('get', '/purchasePrice/purchasePriceLook', {
- id: this.id
- }).then(res => {
- if (res.data.code == 200) {
- this.list = res.data.data
- }
- })
- },
- confirm(item) {
- this.list.contractNo = item[0].value
- },
- audit() {
- if (!this.rejectInfo1) {
- this.$api.msg('审核意见不能为空!')
- } else {
- var that = this
- that.show2 = false
- uni.showModal({
- content: "是否确定通过审核?",
- showCancel: true,
- confirmText: '确定',
- success: function(res) {
- if (res.confirm) {
- uni.showLoading({
- title: "审核中"
- })
- that.$api.doRequest('post', '/purchasePrice/purchasePriceEdit', that.list)
- .then(res => {
- if (res.data.code == 200) {
- that.$api.doRequest('post', '/workflow/api/handle', {
- approved: true,
- auditMind: that.rejectInfo1,
- needReapply: true,
- taskId: that.list.taskId,
- }).then(res1 => {
- if (res1.data.code == 200) {
- that.$api.msg('审核成功');
- setTimeout(function() {
- if (this.everyCheck) {
- helper.setAudit(that.list)
- } else {
- uni.navigateBack()
- }
- uni.hideLoading()
- }, 1000);
- } else {
- that.$api.msg(res1.data.message);
- }
- })
- } else {
- that.$api.msg('系统异常,请联系管理员');
- }
- })
- }
- }
- })
- }
- },
- reject() {
- if (!this.rejectInfo) {
- this.$api.msg('驳回原因不能为空!')
- } else {
- var that = this
- that.show1 = false
- uni.showModal({
- content: "是否确定驳回?",
- showCancel: true,
- confirmText: '确定',
- success: function(res) {
- if (res.confirm) {
- that.$api.doRequest('post', '/workflow/api/handle', {
- taskId: that.list.taskId,
- approved: false,
- auditMind: that.rejectInfo,
- needReapply: true,
- }).then(res1 => {
- if (res1.data.code == 200) {
- that.$api.msg('驳回成功');
- setTimeout(function() {
- if (that.everyCheck) {
- helper.setAudit(that.list)
- } else {
- uni.navigateBack()
- }
- uni.hideLoading()
- }, 1000);
- } else {
- that.$api.msg(res1.data.message);
- }
- })
- }
- }
- })
- }
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .warp {
- margin: 10rpx;
- padding: 20rpx 20rpx 330rpx 20rpx;
- }
- .content1,
- .content2 {
- border-radius: 20rpx;
- background: white;
- padding: 20rpx;
- .title {
- font-size: 28rpx;
- font-weight: 600;
- color: #333333;
- text-align: left;
- }
- .row {
- display: flex;
- justify-content: space-between;
- border-bottom: 1px solid #EEEEEE;
- padding: 21rpx 0;
- .right,
- input {
- font-size: 28rpx;
- color: #333333;
- }
- }
- }
- .content2 {
- margin-top: 20rpx;
- }
- .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;
- }
- }
- .submit {
- width: 40%;
- background: #22C572;
- border-radius: 10rpx;
- }
- .boder {
- border: 0;
- border-bottom: 0 !important;
- }
- .topInfo {
- height: 210rpx;
- background: linear-gradient(270deg, #22C572 0%, #34DE8A 100%);
- padding: 30rpx;
- .topInfo-item {
- height: 150rpx;
- background-color: #FFFFFF;
- border-radius: 20rpx;
- padding: 40rpx;
- .logo {
- width: 40rpx;
- height: 40rpx;
- margin-top: 8rpx;
- }
- .infoText {
- font-size: 36rpx;
- font-weight: 600;
- margin-left: 20rpx;
- }
- .infoData {
- color: #878C9C;
- font-size: 26rpx;
- margin-top: 10rpx;
- }
- }
- }
- .rejectInfoCss {
- border: 1px solid #ccc;
- border-radius: 10rpx;
- background-color: #F9F9FA;
- // height: 100px;
- overflow-y: auto;
- margin: 30rpx;
- }
- .rejectText {
- text-align: center;
- }
- /deep/.u-input__textarea {
- height: 300rpx !important;
- }
- </style>
|