123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- <template name="task">
- <view class="content">
- <u-form :model="form" ref="uForm">
- <u-form-item label-width='260' label="合同编号">
- <view @click="show = true">{{list.contractNo?list.contractNo:'请选择合同编号'}}</view>
- <u-select v-model="show" mode="single-column" :list="contractNoList" @confirm="confirm"></u-select>
- </u-form-item>
- <u-form-item label-width='260' label="采购计划">
- {{list.salePlan}}
- </u-form-item>
- <u-form-item label-width='260' label="客户">
- {{list.buyer}}
- </u-form-item>
- <u-form-item v-if='list.salePlanType=="现货"' label-width='260' label="单价(元/吨)">
- <u-input v-model="list.unitPrice" />
- </u-form-item>
- <u-form-item v-if='list.salePlanType=="期货"' label-width='260' label="基差(元/吨)">
- {{list.basis}}
- </u-form-item>
- <u-form-item v-if='list.salePlanType=="期货"' label-width='260' label="冻结定金(元)">
- {{list.freezingDeposit}}
- </u-form-item>
- <u-form-item v-if='list.salePlanType=="期货"' label-width='260' label="拖欠定金(元)">
- {{list.defaultDeposit}}
- </u-form-item>
- <u-form-item v-if='list.salePlanType=="期货"' label-width='260' label="卸车费(元/吨)">
- {{list.unloadingCharge}}
- </u-form-item>
- <u-form-item v-if='list.salePlanType=="期货"' label-width='260' label="发票费(元/吨)">
- {{list.invoiceFee}}
- </u-form-item>
- <u-form-item label-width='260' label="合同重量(吨)">
- {{list.transactionsNumber}}
- </u-form-item>
- <u-form-item v-if='list.salePlanType=="期货"' label-width='260' label="已出库量(吨)">
- {{list.stockOutQuantity}}
- </u-form-item>
- <u-form-item v-if='list.salePlanType=="期货"' label-width='260' label="可平仓量(吨)">
- {{list.openPosition}}
- </u-form-item>
- <u-form-item v-if='list.salePlanType=="期货"' label-width='260' label="已平仓量(吨)">
- {{list.closedPosition}}
- </u-form-item>
- <u-form-item v-if='list.salePlanType=="期货"' label-width='260' label="已成交量(吨)">
- {{list.cumulativeTurnover}}
- </u-form-item>
- <u-form-item label-width='260' label="发票类型">
- {{list.type}}
- </u-form-item>
- <u-form-item label-width='260' label="包装方式">
- {{list.packingType}}
- </u-form-item>
- <u-form-item label-width='260' label="状态">
- {{list.status}}
- </u-form-item>
- <u-form-item label-width='260' label="更新时间">
- {{list.updateDate}}
- </u-form-item>
- </u-form>
- <view style='padding:10px;' class='flex'><u-button v-if='list.status=="待审核"' @click='audit' type="success">审核</u-button></view>
- </view>
- </template>
- <script>
- import {
- mapState
- } from 'vuex';
- export default {
- name: "task",
-
- data() {
- return {
- show:false,
- id:0,
- form: {
- name: '',
- intro: '',
- sex: ''
- },
- list:{},
- radio: '',
- pcUserInfo:uni.getStorageSync('pcUserInfo'),
- switchVal: false,
- contractNoList:[]
- };
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo'])
- },
- onLoad(options){
- console.log(options)
- this.id=options.id
- },
- onShow() {
- var that=this
- this.$nextTick(function(){
- that.getData()
- })
-
- // this.userInfo = uni.getStorageSync("userInfo")
- },
- methods: {
- getData(){
- var data=[]
- this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList',
- {compId:this.pcUserInfo.compId,flag:3}).then(res => {
- if(res.data.code==200){
- for(var i=0;i<res.data.data.length;i++){
- data.push({value:res.data.data[i].contractNo,label:res.data.data[i].contractNo})
- }
- this.contractNoList=data
- }
- })
- this.$api.doRequest('get', '/saleOrder/getInfo', {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.list.salePlanType == '期货') {
- this.list.freezingDeposit = this.list.transactionsNumber*this.list.customerInfo.depositRatio
- }
- var that=this
- uni.showModal({
- content: "审核通过后,将通知客户订单生效,是否确定通过审核?",
- showCancel: true,
- confirmText: '提交',
- success: function(res) {
- if (res.confirm) {
- that.$api.doRequest('post', '/saleOrder/api/editSaleOrder', that.list).then(res => {
- if (res.data.code == 200) {
- that.$api.doRequest('post', '/newWorkflow/api/handle', {
- taskId:that.list.taskId,
- approved: true,
- auditMind: '34',
- needReapply: false,
- }).then(res1 => {
- if (res1.data.code == 200) {
- that.$api.msg('审核成功');
- that.$nextTick(function(){
- uni.navigateBack(-1)
- })
- }else{
- that.$api.msg('系统异常,请联系管理员');
- }
- })
- }else{
- that.$api.msg('系统异常,请联系管理员');
- }
- })
- }
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- page{
- background: #fff;
- }
- .content{
- padding:30px;
- }
- </style>
|