procurement_details.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template name="task">
  2. <view class="content">
  3. <u-form :model="form" ref="uForm">
  4. <u-form-item label-width='260' label="合同编号">
  5. <view @click="show = true">{{list.contractNo?list.contractNo:'请选择合同编号'}}</view>
  6. <u-select v-model="show" mode="single-column" :list="contractNoList" @confirm="confirm"></u-select>
  7. </u-form-item>
  8. <u-form-item label-width='260' label="采购计划">
  9. {{list.procurementPlan}}
  10. </u-form-item>
  11. <u-form-item label-width='260' label="客户">
  12. {{list.seller}}
  13. </u-form-item>
  14. <u-form-item v-if='list.procurementPlanType=="现货"' label-width='260' label="单价(元/吨)">
  15. <u-input v-model="list.unitPrice" />
  16. </u-form-item>
  17. <u-form-item v-if='list.procurementPlanType=="期货"' label-width='260' label="基差(元/吨)">
  18. {{list.basis}}
  19. </u-form-item>
  20. <u-form-item v-if='list.procurementPlanType=="期货"' label-width='260' label="冻结定金(元)">
  21. {{list.freezingDeposit}}
  22. </u-form-item>
  23. <u-form-item v-if='list.procurementPlanType=="期货"' label-width='260' label="拖欠定金(元)">
  24. {{list.defaultDeposit}}
  25. </u-form-item>
  26. <u-form-item v-if='list.procurementPlanType=="期货"' label-width='260' label="卸车费(元/吨)">
  27. {{list.unloadingCharge}}
  28. </u-form-item>
  29. <u-form-item v-if='list.procurementPlanType=="期货"' label-width='260' label="发票费(元/吨)">
  30. {{list.invoiceFee}}
  31. </u-form-item>
  32. <u-form-item label-width='260' label="合同重量(吨)">
  33. {{list.transactionsNumber}}
  34. </u-form-item>
  35. <u-form-item v-if='list.procurementPlanType=="期货"' label-width='260' label="已入库量(吨)">
  36. {{list.stockInQuantity}}
  37. </u-form-item>
  38. <u-form-item v-if='list.procurementPlanType=="期货"' label-width='260' label="可平仓量(吨)">
  39. {{list.openPosition}}
  40. </u-form-item>
  41. <u-form-item v-if='list.procurementPlanType=="期货"' label-width='260' label="已平仓量(吨)">
  42. {{list.closedPosition}}
  43. </u-form-item>
  44. <u-form-item v-if='list.procurementPlanType=="期货"' label-width='260' label="已成交量(吨)">
  45. {{list.cumulativeTurnover}}
  46. </u-form-item>
  47. <u-form-item label-width='260' label="发票类型">
  48. {{list.type}}
  49. </u-form-item>
  50. <u-form-item label-width='260' label="包装方式">
  51. {{list.packingType}}
  52. </u-form-item>
  53. <u-form-item label-width='260' label="状态">
  54. {{list.status}}
  55. </u-form-item>
  56. <u-form-item label-width='260' label="更新时间">
  57. {{list.updateDate}}
  58. </u-form-item>
  59. </u-form>
  60. <view style='padding:10px;' class='flex'><u-button v-if='list.status=="待审核"' @click='audit' type="success">审核</u-button></view>
  61. </view>
  62. </template>
  63. <script>
  64. import {
  65. mapState
  66. } from 'vuex';
  67. export default {
  68. name: "task",
  69. data() {
  70. return {
  71. show:false,
  72. id:0,
  73. form: {
  74. name: '',
  75. intro: '',
  76. sex: ''
  77. },
  78. list:{},
  79. radio: '',
  80. pcUserInfo:uni.getStorageSync('pcUserInfo'),
  81. switchVal: false,
  82. contractNoList:[]
  83. };
  84. },
  85. computed: {
  86. ...mapState(['hasLogin', 'userInfo'])
  87. },
  88. onLoad(options){
  89. console.log(options)
  90. this.id=options.id
  91. },
  92. onShow() {
  93. var that=this
  94. this.$nextTick(function(){
  95. that.getData()
  96. })
  97. // this.userInfo = uni.getStorageSync("userInfo")
  98. },
  99. methods: {
  100. getData(){
  101. this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList',
  102. {compId:this.pcUserInfo.compId,flag:3}).then(res => {
  103. var data=[]
  104. if(res.data.code==200){
  105. if(res.data.data.length>0){
  106. for(var i=0;i<res.data.data.length;i++){
  107. data.push({value:res.data.data[i].contractNo,label:res.data.data[i].contractNo})
  108. }
  109. }
  110. this.contractNoList=data
  111. }
  112. })
  113. this.$api.doRequest('get', '/purchaseOrder/getInfo', {id:this.id}).then(res => {
  114. if(res.data.code==200){
  115. this.list=res.data.data
  116. }
  117. })
  118. },
  119. confirm(item){
  120. this.list.contractNo=item[0].value
  121. },
  122. audit(){
  123. if (this.list.procurementPlanType == '期货') {
  124. this.list.freezingDeposit = this.list.transactionsNumber*this.list.customerInfo.depositRatio
  125. }
  126. console.log(this.list)
  127. var that=this
  128. uni.showModal({
  129. content: "审核通过后,将通知客户订单生效,是否确定通过审核?",
  130. showCancel: true,
  131. confirmText: '提交',
  132. success: function(res) {
  133. if (res.confirm) {
  134. that.$api.doRequest('post', '/purchaseOrder/api/editPurchaseOrder', that.list).then(res1 => {
  135. if (res1.data.code == 200) {
  136. that.$api.doRequest('post', '/workflow/api/handle', {
  137. taskId:that.list.taskId,
  138. approved: true,
  139. auditMind: '34',
  140. needReapply: false,
  141. }).then(res2 => {
  142. if (res2.data.code == 200) {
  143. that.$api.msg('审核成功');
  144. that.$nextTick(function(){
  145. uni.navigateBack(-1)
  146. })
  147. }else{
  148. that.$api.msg('系统异常,请联系管理员');
  149. }
  150. })
  151. }else{
  152. that.$api.msg('系统异常,请联系管理员');
  153. }
  154. })
  155. }
  156. }
  157. })
  158. }
  159. }
  160. }
  161. </script>
  162. <style lang="scss" scoped>
  163. page{
  164. background: #fff;
  165. }
  166. .content{
  167. padding:30px;
  168. }
  169. </style>